Reformatting Records Using OUTREC - Part 1

IF THEN in sort, OVERLAY in sort - Example Input file for SORT card 10 suresh 20000 01 20 NARENDRA 40000 06 30 jacob A 25000 07 40 RAMESH 34000 03 50 Kishore 50000 02 //SYSIN DD * SORT FIELDS=COPY OUTREC IFTHEN=(WHEN=(1,2,FS,EQ,30),OVERLAY=(45:C'YES')), - IFTHEN=(WHEN=NONE,OVERLAY=(45:C'NO')) /* Explanation - If input record has 30 in the 1st position, string YES will be moved to 45th position If you want a binary value to made readable , you can do so by converting it to an equivalent Zoned Decimal. OPTION COPY OUTREC FIELDS=(1,4,BI,TO=ZD) The TO=ZD parameter converts the 4 byte binary fields to its equivalent zoned decimal value in the output file. † INCLUDE/OMIT, INREC, OUTREC and OUTFIL Control Statements † The new DATE5 subparameter generates a date that includes microseconds in the form 'yyyy-mm-dd-hh.mm.ss.nnnnnn'. † INREC, OUTREC and OUTFIL OUTREC Control Statements † The new VL subparameter allows you to create a variable-length field from justified or squeezed fields. You can create the reformatted OUTREC records in one of the following three ways using unedited, edited, or converted input fields (p,m for fixed fields, or %nn for parsed fields - see PARSE), and a variety of constants: . BUILD or FIELDS: Reformat each record by specifying all of its items one by one. Build gives you complete control over the items you want in your reformatted OUTREC records SORT – OUTREC – TRAN In SORT, you can make use of TRAN=keyword to do the following functions. TRAN=UTOL translates uppercase letter (A-Z) in the field to the equivalent lowercase letter (a-z). Input file: RAJESH SURESH RAMS SUNIL CHIRU Output File: Rajesh Suresh Rams Sunil Chiru OUTREC in the sort would look as below so…

[index] [14197] [10593] [16266] [30083] [29808] [2198] [501] [8028] [5055] [2709]

Flag Counter