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
Move and Edited Output2 Numeric LiteralB PIC MEMORY LOCATIONS FOR B (6)_________________________ (5)_________________________ (8)_________________________ (5)_________________________ (4)V99 _________________________ (6)V9(3)_________________________ (6)V9_________________________ (3)V9_________________________ 12345S9(6)_________________________ S9(6)_________________________ (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
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
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
Move and Edited Output5 Edited Output Characters REMEMBER… each character holds a place in memory EX. $9, 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
Move and Edited Output6 Value of Picture of Sending FieldReceiving FieldEdit Result XXXBXXBXXXX392b38b XX/XX/XXXX03/21/ B99B b38b /99/999903/21/ ,000125, ZZZ ZZZ.99bb Z,ZZZ.991, Z,ZZZ.99bbb Z,ZZZ.99bbbbb ZZZ,ZZZ-bb1,234b -1234ZZZ,ZZZ-bb1, ZZZ,ZZZ+bb1, ZZZ,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”
Move and Edited Output7 Value of Picture of Sending FieldReceiving FieldEdit Result 1234$ZZZ,ZZZ$bb1, $ZZZZ.99$ $ZZZZ.99$ $$,$$$.99$1, $$,$$$.999bbb$ $*,***.99$1, $*,***.99$*** **,***.99*1, , , , , ,+++.99bbb ,+++.99bbb , , , , ,---.99bbbb ,---.99bbb Edited Output Examples cont REMINDER: the length of the “picture of receiving field” will always be the same length as the “edit result”