Presentation is loading. Please wait.

Presentation is loading. Please wait.

Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as.

Similar presentations


Presentation on theme: "Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as."— Presentation transcript:

1 Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as defined by the pic clause), fill to the right with blanks. If the length of the data is larger than the length of the field (as defined by the pic clause), truncate the data that does not fit into the memory location. NUMERIC integer portion: Right justify the data in the integer portion of the memory location. If the length of the data is smaller than the length of the integer portion of the field (as defined by the pic clause), then fill to the left with zeros. If the length of the data is larger than the length of the integer portion of the field (as defined by the pic clause), then truncate the data to the left that does not fit into the memory location. NUMERIC decimal portion: Left justify the data into the decimal portion of the memory location. If the length of the data is smaller than the length of the decimal portion of the field (as defined by the pic clause), then fill to the right with zeros. If the length of the data is larger than the length of the decimal portion of the field (as defined by the pic clause), then truncate the data to the right that does not fit into the memory location. SIGN: The S character in a PIC clause denotes that the data for that memory location can be a positive or negative value. The sign, however, does not take up a position in memory! FYI: Remember that truncation is used… not rounding! The MOVE Statement Rules for Receiving Field

2 Move and Edited Output2 Numeric LiteralB PIC MEMORY LOCATIONS FOR B 123456 9(6)_________________________ 123456 9(5)_________________________ 123456 9(8)_________________________ 1234.56 9(5)_________________________ 123.456 9(4)V99 _________________________ 1234.56 9(6)V9(3)_________________________ 1234.56 9(6)V9_________________________ 1234.56 9(3)V9_________________________ 12345S9(6)_________________________ -12345S9(6)_________________________ -123459(6)_________________________ MOVE numeric-literal TO B. Fill in every memory location for B… use a b (lower case letter b) to denote a blank THE MOVE STATEMENT cont

3 Move and Edited Output3 Non-Numeric Literal B PIC MEMORY LOCATIONS FOR B kitty A(10)_________________________ kitty X(8)_________________________ 10 caps A(10)_________________________ 10 caps X(5)_________________________ MOVE non-numeric-literal TO B. Fill in every memory location for B… use a b (lower case letter b) to denote a blank THE MOVE STATEMENT cont

4 Move and Edited Output4 Legal and Illegal MOVEs Type of MoveLegal? Alphabetic to alphabeticYes Alphabetic to alphanumericYes Alphabetic to alphanumeric editedYes Alphanumeric to alphanumericYes Alphanumeric to alphanumeric editedYes Alphanumeric to alphabeticOnly if sending field is alphabetic Alphanumeric to numericOnly if sending field is an unsigned integer Alphanumeric to numeric editedOnly if sending field is an unsigned integer Numeric to numericYes Numeric to numeric editedYes Numeric to alphanumericOnly if sending field is an unsigned integer Numeric to alphanumeric editOnly if sending field is an unsigned integer Numeric edited to numericYes, to de-edit a field Alphanumeric edited to alphanumericYes, but does not de-edit a field

5 Move and Edited Output5 Edited Output Characters REMEMBER… each character holds a place in memory EX. $9,999.99 1. Insertion characters (alphnumeric editing)  B and / can be used in the picture clause and that positions takes on a blank space or the / character 2. Insertion characters (numeric editing)  same as above using B / and 0 3. Zero suppression  (numeric editing) the letter Z denotes a blank if position is zero 4. Sign control  plus and minus sign to the right of the field; + denotes that you want the sign to show; - denotes that you only want the sign to show up if the value is negative… still holds a place in memory, but is blank 5. Fixed dollar sign  $ always shows up in the placed position 6. Floating dollar sign  $ shows up to the left of the most significant digit; non- significant positions are filled in with blanks (including commas!) 7. Check protection  asterisks (*) show up to the left of the most significant digit 8. Floating plus sign  + (see floating $ and sign control) 9. Floating minus sign  - (see floating $ and sign control 10. Other  comma and decimal point

6 Move and Edited Output6 Value of Picture of Sending FieldReceiving FieldEdit Result 392380401 XXXBXXBXXXX392b38b0401 03212000XX/XX/XXXX03/21/2000 392380401999B99B9999392b38b0401 321200099/99/999903/21/2000 125999000125000 125999,000125,000 123.45ZZZ.99123.45 1.23ZZZ.99bb1.23 1420.90Z,ZZZ.991,420.90 12.42Z,ZZZ.99bbb12.42.09Z,ZZZ.99bbbbb.09 1234ZZZ,ZZZ-bb1,234b -1234ZZZ,ZZZ-bb1,234- 1234ZZZ,ZZZ+bb1,234+ -1234ZZZ,ZZZ+bb1,234- Edited Output Examples REMINDER: the length of the “picture of receiving field” will always be the same length as the “edit result”

7 Move and Edited Output7 Value of Picture of Sending FieldReceiving FieldEdit Result 1234$ZZZ,ZZZ$bb1,234 1234.56$ZZZZ.99$1234.56 11234.56$ZZZZ.99$1234.56 1420.90$$,$$$.99$1,420.90 12.42$$,$$$.999bbb$12.420 1420.90$*,***.99$1,420.90 12.42$*,***.99$***12.42 1234.56**,***.99*1,234.56 1420.90++,+++.99+1,420.90 -1420.90++,+++.99-1,420.90 12.42++,+++.99bbb+12.42 -12.42++,+++.99bbb-12.42 1420.90--,---.991,420.90 -1420.90--,---.99-1,420.90 12.42--,---.99bbbb12.42 -12.42--,---.99bbb-12.42 Edited Output Examples cont REMINDER: the length of the “picture of receiving field” will always be the same length as the “edit result”


Download ppt "Move and Edited Output1 NON-NUMERIC: Left justify the data in the memory location. If the length of the data is smaller than the length of the field (as."

Similar presentations


Ads by Google