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

Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
Hi Team,
I need to compare below 2 files:-
<-- File 1 -->
| Code: |
JOBNAME DATE
G7D204MM 09212017
G7D201MM 09212017
G7D203MM 09212017
G7D809MM 09212017
G7D327MM 09212017
|
<-- File 2 -->
| Code: |
JOBNAME TIME
G7D204MM 0645
G7D201MM 0605
G7D203MM 0610
G7D809MM 0253
G7D327MM 0641
|
1) I need to compare JOBNAME in both the file.
2) If JOBNAME matches I need to compare the date in file 1 with current date.
3) If date matches then write in output file "JOBNAME ran fine. "
4) If date is not current date then pick details from File2 and write in output file "JOBNAME should run before TIME."
5) If JOBNAME in File 2 not found in File 1 then write JOBNAME have no entry or never ran." |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2283 Location: USA
|
|
|
|
If you NEED to do something, what prevents you from doing this???
This is not forum to assign your own job to others. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Hint: DFSORT JOINKEYS. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Don't use colour tags - use code tags.
Don't use files - use data sets. |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Assuming LRECL=80.
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
HDATE,S'&MON.&DAY.&YR4'
//SORTJNF1 DD *
G7D204MM 09232017
G7D201MM 09232017
G7D203MM 09212017
G7D809MM 09212017
G7D327MM 09212017
//SORTJNF2 DD *
JOBNAME
G7D204MM 0645
G7D201MM 0605
G7D203MM 0610
G7D809MM 0253
G7D327MM 0641
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,08,A)
JOINKEYS FILE=F2,FIELDS=(1,08,A)
REFORMAT FIELDS=(F1:1,17,F2:1,8,10,4,?)
OPTION COPY
JOIN UNPAIRED,F2
OUTREC IFTHEN=(WHEN=(30,1,CH,EQ,C'B',AND,
10,8,CH,EQ,HDATE),
BUILD=(1,8,C' RAN FINE',80:X)),
IFTHEN=(WHEN=(30,1,CH,EQ,C'B',AND,
10,8,CH,NE,HDATE),
BUILD=(1,8,C' SHOUD RUN BEFORE ',26,4,80:X)),
IFTHEN=(WHEN=(30,1,CH,EQ,C'2'),
BUILD=(18,8,C' HAVE NO ENTRY OR EVER RAN',80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(18,8,C' UNHANDLED CONDITION',80:X))
|
|
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Nic,
I have seen in many post you have quoted not use files.
| Nic wrote: |
Don't use files - use data sets.
|
Please advise why DFSORT has "file" in their code, or DFSORT team needs to correct it ?
| Code: |
JOINKEYS FILE=F2,FIELDS=(1,08,A)
|
|
|
| Back to top |
|
 |
arunsoods
New User

Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
Hi Magesh/Team,
Thanks for the responses while running above sort card I am getting below error. I have searched web but didn't found any appropriate solution.
| Code: |
JOINKEYS FILE=F1,FIELDS=(1,08,A)
JOINKEYS FILE=F2,FIELDS=(1,08,A)
REFORMAT FIELDS=(F1:1,17,F2:1,8,10,4,?)
JOIN UNPAIRED,F2
SORT FIELDS=COPY
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER274A CONTINUATION STATEMENT ERROR FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
Regards
Arun |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Magesg
On the mainframe 'file' can be directly related to the 'DDNAME' which then relates to the data set. Within the program the DDNAME is referred to as FILE:
In PL/1..
| Code: |
| DCL infile FILE .... |
JCL:
| Code: |
| //INFILE DD DSN=data.set.name |
and this relationship is clearly explained in one of the (PL/1) manuals. |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
| arunsoods wrote: |
Hi Magesh/Team,
Thanks for the responses while running above sort card I am getting below error. I have searched web but didn't found any appropriate solution.
| Code: |
JOINKEYS FILE=F1,FIELDS=(1,08,A)
JOINKEYS FILE=F2,FIELDS=(1,08,A)
REFORMAT FIELDS=(F1:1,17,F2:1,8,10,4,?)
JOIN UNPAIRED,F2
SORT FIELDS=COPY
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER274A CONTINUATION STATEMENT ERROR FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
Regards
Arun |
Can you give us complete sysout log.
Moderator,
Please move this to syncsort. |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
| Nic Clouston wrote: |
Magesg
On the mainframe 'file' can be directly related to the 'DDNAME' which then relates to the data set. Within the program the DDNAME is referred to as FILE:
In PL/1..
| Code: |
| DCL infile FILE .... |
JCL:
| Code: |
| //INFILE DD DSN=data.set.name |
and this relationship is clearly explained in one of the (PL/1) manuals. |
Thanks Nic. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|