Professional Documents
Culture Documents
Short
Short
********************************************************************
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,92,C'80',93,10)
(This is simple. What this means is that you want your output file to show only
the
first 92 bytes of the input file (i.e. position 1 to 92), and then followed by a
hard
coded 80 (you are telling it to put a 2 byte character there which is 80), and t
hen
followed by the next 10 bytes of your input file (i.e. you are telling it to the
n copy
to the output file whatever is in position 93 of the input file, for 10 bytes).
The outrec
example is simple once you use it a few times. Basically you are just identifyi
ng what
field on the input to be included on the output, and its called the outrec para
meter.
*****************************************************
I have a file which has a field containing values ranging from (1-7).
Depending on these values I have to Overlay(Overwrite) that field in the O/P fil
e with (SYSDATE-n) where n is the value of that field in the I/P file.
The O/P will have the date in the format CCYY-MM-DD.
//S01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1
2
3
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),
OVERLAY=(1:DATE1(-)-1)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),
OVERLAY=(1:DATE1(-)-2)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),
OVERLAY=(1:DATE1(-)-3))
/*