|
View previous topic :: View next topic
|
| Author |
Message |
sureshkumar_p01
New User
Joined: 22 Feb 2007 Posts: 7 Location: bangalore
|
|
|
|
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? |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1217 Location: Dublin, Ireland
|
|
|
|
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).
Garry. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sureshkumar_p01,
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.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=Your input FB80 file,DISP=SHR
//SORTJNF2 DD DSN=your input FB130 file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS FILES=F1,FIELDS=(11,8,A)
JOINKEYS FILES=F2,FIELDS=(03,8,A)
REFORMAT FIELDS=(F1:11,8,?,F2:03,8)
OUTFIL NULLOFL=RC4,INCLUDE=(1,8,CH,EQ,10,8,CH,AND,9,1,CH,EQ,C'B')
//JNF1CNTL DD *
INCLUDE COND=(1,1,CH,EQ,C'1')
//JNF2CNTL DD *
INCLUDE COND=(1,1,CH,EQ,C'0')
//* |
For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
| Gary Carroll wrote: |
| If the result is a match, ICETOOL sets RC=0 else sets RC=12 (sorry,not RC-4, as requested). |
Garry,
What makes you think that DFSORT can't set an RC=4? DFSORT indeed supports setting of RC=4. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1217 Location: Dublin, Ireland
|
|
|
|
| Quote: |
Garry,
What makes you think that DFSORT can't set an RC=4? DFSORT indeed supports setting of RC=4.
|
I didn't say that DFSORT can't set RC=4. The specific approach I outlined with ICETOOL would set RC=0 or RC=12. I don't have the Nov, 2009 DFSORT PTF available on my systems.
Like your solution, though.
Garry. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| You can use RC4 with ICETOOL COUNT to set RC=4. This option has been available since Dec, 2004. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|