Compare HEADER DATE WITH RECORD DATE



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Compare HEADER DATE WITH RECORD DATE

Postby gauravfrankly » Fri Aug 14, 2015 11:50 am

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.
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare HEADER DATE WITH RECORD DATE

Postby hailashwin » Mon Aug 17, 2015 12:17 pm

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.
hailashwin
 
Posts: 5
Joined: Wed Jan 05, 2011 5:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare HEADER DATE WITH RECORD DATE

Postby BillyBoyo » Mon Aug 17, 2015 12:37 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Compare HEADER DATE WITH RECORD DATE

Postby gauravfrankly » Mon Aug 17, 2015 6:27 pm

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.
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare HEADER DATE WITH RECORD DATE

Postby gauravfrankly » Mon Aug 17, 2015 6:29 pm

Hi Ashwin,
I am not getting your hint, can you please give a bit details or an example for the same.
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare HEADER DATE WITH RECORD DATE

Postby gauravfrankly » Mon Aug 17, 2015 6:48 pm

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
gauravfrankly
 
Posts: 39
Joined: Fri Aug 07, 2015 3:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare HEADER DATE WITH RECORD DATE

Postby BillyBoyo » Mon Aug 17, 2015 7:34 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post