Tags

, , , ,

SORT – EDIT MASK PATTERNS

When you want the sort to present your input numeric field in a format that you want in your output, you can make use of already available edit mask patterns provided below.

In the patterns:

  1. I indicates a leading insignificant digit to be displayed as 1-9, or as blank for a leading 0.
  1. T indicates a significant digit to be displayed as 0-9.
  1. S before the digits indicates a leading sign. S after the digits indicates a trailing sign. For M4, the leading sign is to be displayed as + for a positive value or as − for a negative value. For EDIT=(SI,III,III,IIT.TTT),SIGNS=(,−), the leading sign is to be displayed as blank for a positive value or as − for a negative value.
  1. Any other character (for example, comma, decimal point or hyphen) is just displayed as appropriate.
MASK

PATTERN

Example 1

Example 2

Value

Result

Value

Result

M0 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIITS +01234 1234 −00001 1−
M1 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTS −00123 00123− +00123 00123
M2 II,III,III,III,III,III,III,III,III,IIT.TTS +123450 1,234.50 −000020 0.20−
M3 II,III,III,III,III,III,III,III,III,IIT.TTCR −001234 12.34CR +123456 1,234.56
M4 SII,III,III,III,III,III,III,III,III,IIT.TT +0123456 +1,234.56 −1234567 −12,345.67
M5 SII,III,III,III,III,III,III,III,III,IIT.TTS −001234 (12.34) +123450 1,234.50
M6 III-TTT-TTTT 00123456 012-3456 12345678 1-234-56788
M7 TTT-TT-TTTT 00123456 000-12-3456 12345678 012-34-5678
M8 IT:TT:TT 030553 3:05:53 121736 12:17:36
M9 IT/TT/TT 123004 12/30/04 083104 8/31/04
M10 IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT 01234 1234 00000 0
M11 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 00010 00010 01234 01234
M12 SI,III,III,III,III,III,III,III,III,III,IIT +1234567 1,234,567 −0012345 −12,345
M13 SI.III.III.III.III.III.III.III.III.III.IIT +1234567 1.234.567 −0012345 −12.345
M14 SI III III III III III III III III III IITS +1234567 1 234 567 −0012345 (12 345)
M15 I III III III III III III III III III IITS +1234567 1 234 567 −0012345 12 345−
M16 SI III III III III III III III III III IIT +1234567 1 234 567 −0012345 −12 345
M17 SI’III’III’III’III’III’III’III’III’III’IIT +1234567 1’234’567 −0012345 −12’345
M18 SII,III,III,III,III,III,III,III,III,IIT.TT +0123456 1,234.56 −1234567 −12,345.67
M19 SII.III.III.III.III.III.III.III.III.IIT,TT +0123456 1.234,56 −1234567 −12.345,67
M20 SI III III III III III III III III IIT,TTS +0123456 1 234,56 −1234567 (12 345,67)
M21 II III III III III III III III III IIT,TTS +0123456 1 234,567 −1234567 12 345,67−
M22 SI III III III III IIII III III III IIT,TT +0123456 1 234,56 −1234567 −12 345,67
M23 SII’III’III’III’III’III’III’III’III’IIT.TT +0123456 1’234.56 −1234567 −12’345.67
M24 SII’III’III’III’III’III’III’III’III’IIT,TT +0123456 1’234,56 −1234567 −12’345,67
M25 SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT +01234 1234 −00001 −1
M26 STTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 1234 +01234 −1 −00001

——————————————————————————————————–

In United States, If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

——————————————————————————————————–

You may also like to look at:

Working on Mainframes – Is Change to a different technology necessary
SORT – CONVERT PD to ZD and BI to ZD
SORT – EDIT FIRST AND LAST RECORD
SORT – EDIT MASK PATTERNS
SORT – EDIT NUMERIC FIELDS (I,T,S)
SORT – FINDREP, IFTHEN and INREC
SORT – How to use VB dataset (VLSHRT)
SORT – INCLUDE and OMIT
SORT – INREC, INCLUDE and OMIT
SORT – JUSTIFY, SQUEEZE and OVERLAY
SORT – LOOKUP AND CHANGE
SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS
SORT – OUTREC – TRAN
SORT – PARSE – REFORMAT VARIABLE FIELDS
SORT – Process Order of CONTROL Statements
SORT – REMOVE DUPLICATES AND WRITE THEM TO XSUM
SORT – SET RETURN CODE ‘04’ IF OUTPUT FILE IS EMPTY
SORT – SKIPREC and STOPAFT
SORT – SUM FIELDS
SORT – TO REPLACE A CHAR WITH ANOTHER CHAR – ALTSEQ
SORT – INREC
SORT – SYMBOLS
SORT JOB – SIMPLE COPY
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
SORT JOIN – UNPAIRED RECORDS INDICATOR