I have 2 files
File 1: FB, LRECL 80, has date from col 11 with length 8 in header record. header record can be identified using ch'1' in 1st column. Detail records carry different data
FIle 2: FB, LRECL 130, has date from col 3 with length 8. header record can be identified using ch'0 in 1st column. Detail records carry different data
Date on these two files has to be matched (we are interested only in header). If they match step should return 0 else 4. This is basically to check if we have received the file for current day.
can these be achieved using ICETOOL?
You could generate a SYMDEF from the File1 header which would contain the date from that file. Then select the header from File 2 where '0' in col1 and the SYMDEF matches the date in col3 for length 8. Now, use ICETOOL to COUNT the number of resulting records. If the result is a match, ICETOOL sets RC=0 else sets RC=12 (sorry,not RC-4, as requested).
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports the JOINKEYS function which easily validate the header record and set the return code of 4 if they don't match like shown below.