|
View previous topic :: View next topic
|
| Author |
Message |
renzreny
New User

Joined: 16 Oct 2008 Posts: 7 Location: USA
|
|
|
|
Hello Seniors:
I've two sequential file of LRECL=80. Each file will always have one record with 'any possible' valid date on it from Col 1 to 8 in YYYYMMDD format. I just need to compare 'month' portion of each dates and set return codes. Possibly two return codes - one for same month scenario or another for different months scenario
Case-1
For example FileOne and FileTwo have following date records. This case month is same and so set return code, say RC=0.
FileOne
20110301
FileTwo
20110331
Case-2
For example FileOne and FileTwo have following date records. This case month is different and so set a different return code, say RC=4.
FileOne
20110301
FileTwo
20110401
I wish I could get this done in SORT rather than writing a new program to do this.
Could someone please suggest a simplest and best way in SORT resulting into 'single JCL step' if possible?
FYI...I would verify these return codes in downstream steps of JCL to perform business processing depends on how RC is. Let's not worry about business processing now.
Thanks! |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
20110301
//INB DD *
20110431
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS F1=INA,FIELDS=(05,2,A)
JOINKEYS F2=INB,FIELDS=(05,2,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,08,?,F2:1,8)
OUTFIL INCLUDE=(9,1,CH,EQ,C'B'),NULLOFL=RC4
//*
|
Gerry |
|
| Back to top |
|
 |
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi,
Please use below mentioned SORT card.
| Code: |
//STEP01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//INPUT1 DD *
20110301
/*
//INPUT2 DD *
20110431
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,NULLOUT=RC4
JOINKEYS F1=INPUT1,FIELDS=(5,02,A)
JOINKEYS F2=INPUT2,FIELDS=(5,02,A)
REFORMAT FIELDS=(F1:1,80)
/* |
|
|
| Back to top |
|
 |
renzreny
New User

Joined: 16 Oct 2008 Posts: 7 Location: USA
|
|
|
|
I'm getting following syntax error. Any thoughts would be of much help
| Code: |
SYSIN :
OPTION COPY,NULLOUT=RC4
JOINKEYS F1=INPUT1,FIELDS=(5,02,A)
*
JOINKEYS F2=INPUT2,FIELDS=(5,02,A)
*
REFORMAT FIELDS=(F1:1,80)
WER901I **WARNING** SYNCSORT 1.3.2.1 WILL EXPIRE IN 36 DAYS
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000 |
|
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you are using SYNCSORT and not DFSORT, solutions provided were for DFSORT.
Try this for SYNCSORT
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD *
20110301
/*
//SORTJNF2 DD *
20110431
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,NULLOUT=RC4
JOINKEYS FILE=F1,FIELDS=(5,2,A)
JOINKEYS FILE=F2,FIELDS=(5,2,A)
REFORMAT FIELDS=(F1:1,8,F2:1,8)
/* |
Gerry |
|
| Back to top |
|
 |
renzreny
New User

Joined: 16 Oct 2008 Posts: 7 Location: USA
|
|
|
|
Thank you gcicchet and saiprasadh. The suggested code worked well for me. This is the best and smartest way than writing via programming. You guys are amazing. Thanks again for your help and support.
Regards, renz |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|