FMT vs PIC: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
(Created page with "With some exceptions, FMT is best suited to handling strings, whereas PIC is generally used with numeric data only. Image:Help0169.jpg Image:Help0170.jpg<br>...")
 
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
With some exceptions, [[FMT]] is best suited to handling strings, whereas [[PIC]] is generally used with numeric data only.
With some exceptions, [[FMT]] is best suited to handling strings, whereas [[PIC]] is generally used with numeric data only. See the chart below comparing the two:


[[Image:Help0169.jpg]]
[[Image:FmtChart.jpg|750px]]
 
===FMT Syntax===
[[Image:Fmt.png|500px]]<br>


[[Image:Help0170.jpg]]<br>
The FMT spec can be used in the same places that PIC is allowed in INPUT FIELDS, RINPUT FIELDS and PRINT FIELDS statements. The FMT keyword must be followed by up to 40 character identifiers and/or insertion characters.
The FMT spec can be used in the same places that PIC is allowed in INPUT FIELDS, RINPUT FIELDS and PRINT FIELDS statements. The FMT keyword must be followed by up to 40 character identifiers and/or insertion characters.


Line 10: Line 12:
{|
{|
|-valign="top"
|-valign="top"
|width="10%"|'''P or p'''||Protected. Business Rules will not allow the cursor to rest on or change any data that is displayed in this position.
|width="10%"|'''9'''||Allow any number from 0 to 9.
|-valign="top"
|width="10%"|'''a'''||Allow any character from A to Z or a to z, and leave case as entered.
|-valign="top"
|width="10%"|'''G'''||Allow any character from A to Z, a to z, or 0 to 9, and force it to upppercase if its alphabetic.
|-valign="top"
|width="10%"|'''g'''||Allow any character from A to Z, a to z, or 0 to 9, and force it to lowercase if its alphabetic.
|-valign="top"
|width="10%"|'''P or p'''||Protected. Business Rules will not allow the cursor to rest on or change any data that is displayed in this position
|-valign="top"
|width="10%"|'''R'''||Mimic the next character specification. Right flush this part from current position to the end of this part (preceding next R or #), process according to the next character identifier within this part (if R is the only character type used, error [[0805]] will result).
|-valign="top"
|width="10%"|'''X'''||Allow any character and force to uppercase if its alphabetic.
|-valign="top"
|width="10%"|'''x'''||Allow any character and force to lowercase if its alphabetic.
|-valign="top"
|width="10%"|'''Y'''||Allow only Y, y, N, or n, and force it to uppercase.
|-valign="top"
|width="10%"|'''y'''||Allow only Y, y, N, or n, and force it to lowercase.
|-valign="top"
|width="10%"|'''#'''||Mimic the next character specification. Right flush and zero fill from current position to end of this part (preceding next R or #), process according to the next character identifier within this part (if # is the only one used, error [[0805]] will result).
|-valign="top"
|-valign="top"
|}
|}
<br>
<br>
[[Image:Help0171.jpg]]<br>
 
Insertion characters are displayed exactly as they appear in the FMT specification. Business Rules treats any keyboard character that is not a character identifier (listed above) as an insertion character.
Insertion characters are displayed exactly as they appear in the FMT specification. Business Rules treats any keyboard character that is not a character identifier (listed above) as an insertion character.


Insertion characters are inserted for the operator's benefit. They will not be in the data. Note that "P" can be used to protect characters that you want to appear in the data.
Insertion characters are inserted for the operator's benefit. They will not be in the data. Note that "P" can be used to protect characters that you want to appear in the data.
<noinclude>
[[Category:Format Specifications]]
</noinclude>

Latest revision as of 19:09, 31 March 2023

With some exceptions, FMT is best suited to handling strings, whereas PIC is generally used with numeric data only. See the chart below comparing the two:

FMT Syntax


The FMT spec can be used in the same places that PIC is allowed in INPUT FIELDS, RINPUT FIELDS and PRINT FIELDS statements. The FMT keyword must be followed by up to 40 character identifiers and/or insertion characters.

Character identifiers tell the system which characters are allowed in the current position, and they identify the way in which the data part should be formatted for input. (Business Rules considers any section of a FMT spec, which is separated from other sections by one or more insertion characters to be a data part.) The following character identifiers are currently available:

9 Allow any number from 0 to 9.
a Allow any character from A to Z or a to z, and leave case as entered.
G Allow any character from A to Z, a to z, or 0 to 9, and force it to upppercase if its alphabetic.
g Allow any character from A to Z, a to z, or 0 to 9, and force it to lowercase if its alphabetic.
P or p Protected. Business Rules will not allow the cursor to rest on or change any data that is displayed in this position
R Mimic the next character specification. Right flush this part from current position to the end of this part (preceding next R or #), process according to the next character identifier within this part (if R is the only character type used, error 0805 will result).
X Allow any character and force to uppercase if its alphabetic.
x Allow any character and force to lowercase if its alphabetic.
Y Allow only Y, y, N, or n, and force it to uppercase.
y Allow only Y, y, N, or n, and force it to lowercase.
# Mimic the next character specification. Right flush and zero fill from current position to end of this part (preceding next R or #), process according to the next character identifier within this part (if # is the only one used, error 0805 will result).


Insertion characters are displayed exactly as they appear in the FMT specification. Business Rules treats any keyboard character that is not a character identifier (listed above) as an insertion character.

Insertion characters are inserted for the operator's benefit. They will not be in the data. Note that "P" can be used to protect characters that you want to appear in the data.