Page 1 of 1

Compare HEADER DATE WITH RECORD DATE

PostPosted: Fri Aug 14, 2015 11:50 am
by gauravfrankly
Hi All
I have requirement to compare the header date with the date of every record of that file.
if header-date =< record date + 60 days then include this record to my output file.
Can you plz give me a sort control card.
I/P file is FB, header date is present in 1-8 bytes and record date is at 60-68th byte.

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 12:17 pm
by hailashwin
What I can think of is a 2 step process. In the first step create a symname file where you extract the date from the header record and in the second step, have an include cond referencing the parameter on the symname file.

Hope this helps.

Thanks,
Ashwin.

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 12:37 pm
by BillyBoyo
Identify the header with WHEN=GROUP, PUSH the date, adjust the date for the comparison you want with WHEN=INIT then use INCLUDE=/OMIT= on OUTFIL.

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 6:27 pm
by gauravfrankly
Hi Billy,
Can you plz provide me link if in past you explained the same requirement.
I am just a fresher for JCL n SORT. so not getting your high level hint.

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 6:29 pm
by gauravfrankly
Hi Ashwin,
I am not getting your hint, can you please give a bit details or an example for the same.

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 6:48 pm
by gauravfrankly
input file :
header date
seqnum name rollno address record date

2 output files:
1. having header date - record date <= 60
2.having header date - record date >60
output files are fb

Re: Compare HEADER DATE WITH RECORD DATE

PostPosted: Mon Aug 17, 2015 7:34 pm
by BillyBoyo
Get yourself the DFSORT Getting Started Guide.

OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
                BEGIN=(1,6,CH,EQ,C'header'),
                PUSH=(81:8,8))


Run that with your data, and look at the SORTOUT. You will see, on all records, the date from the header is at position 81.