Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Comparing 2 Files using Current time

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Fri Sep 22, 2017 6:00 pm    Post subject: Comparing 2 Files using Current time
Reply with quote

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
View user's profile Send private message

sergeyken

Active User


Joined: 29 Apr 2008
Posts: 189
Location: Maryland

PostPosted: Fri Sep 22, 2017 8:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Fri Sep 22, 2017 8:54 pm    Post subject:
Reply with quote

Hint: DFSORT JOINKEYS.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Sat Sep 23, 2017 4:40 pm    Post subject:
Reply with quote

Don't use colour tags - use code tags.
Don't use files - use data sets.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 210
Location: Chennai

PostPosted: Sun Sep 24, 2017 5:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 210
Location: Chennai

PostPosted: Sun Sep 24, 2017 5:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Mon Sep 25, 2017 1:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Mon Sep 25, 2017 2:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 210
Location: Chennai

PostPosted: Mon Sep 25, 2017 9:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 210
Location: Chennai

PostPosted: Mon Sep 25, 2017 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us