Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Compare input date as YYMMDD with the same in SynSort

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

New User


Joined: 21 Feb 2020
Posts: 2
Location: usa

PostPosted: Fri Feb 21, 2020 10:28 pm    Post subject: Compare input date as YYMMDD with the same in SynSort
Reply with quote

Hi,
I have a 6-digit date field as YYMMDD in column 2 of input file. The requirement is to sort the file and OMIT any records with date less than current date. I can use the Y2T for my input data but I cannot find the date variable in SyncSort representative of the YYMMDD. Any help is appreciated.
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


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

PostPosted: Fri Feb 21, 2020 11:05 pm    Post subject:
Reply with quote

One way is,
Code:
//SORTIN   DD  *                             
D200219                                       
D200221                                       
D200222                                       
D200217                                       
//SORTOUT  DD  SYSOUT=*                       
//SYSIN    DD    *                           
 SORT FIELDS=(2,6,ZD,A)                       
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:DATE1)) 
 OUTFIL REMOVECC,FNAMES=SORTOUT,             
 BUILD=(1,7),INCLUDE=(2,6,ZD,LT,83,6,ZD)     

output:
Code:
*********
D200217 
D200219 
*********
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 147
Location: Germany

PostPosted: Fri Feb 21, 2020 11:48 pm    Post subject:
Reply with quote

Code:
//DATEDIFF EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
D200219                                                   
D200221                                                   
D200222                                                   
D200217                                                   
D991231                                                   
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  INREC IFTHEN=(WHEN=INIT,                                 
    OVERLAY=(81:DATE1,81:2,6,Y2T,DATEDIFF,81,8,Y4T))       
  SORT FIELDS=(81,8,SFF,A)                                 
  OUTFIL FNAMES=(SORTOUT),                                 
    INCLUDE=(81,8,SFF,LT,+0), * anything at least one day old here?
    BUILD=(1,7)                                           
/*

Output:
Code:
D991231
D200217
D200219
Back to top
View user's profile Send private message
Khurshid_Khan

New User


Joined: 21 Feb 2020
Posts: 2
Location: usa

PostPosted: Sat Feb 22, 2020 12:33 am    Post subject:
Reply with quote

Thank you much. Let me try this on my own.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


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

PostPosted: Sat Feb 22, 2020 1:14 am    Post subject:
Reply with quote

Joerg, Why add extra DATEDIFF when we can avoid it ?
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 147
Location: Germany

PostPosted: Sat Feb 22, 2020 1:24 am    Post subject:
Reply with quote

@Rohit: It's intended for interested parties to see a different approach.
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
No new posts Compare Two datasets and get the 1st ... ArunkumarGanesan DFSORT/ICETOOL 4 Fri Mar 27, 2020 2:00 am
No new posts convert SUPERC compare report to side... jzhardy CLIST & REXX 5 Fri Feb 21, 2020 8:55 am
No new posts Need a Macro to compare datasets and ... Anupam Nayak All Other Mainframe Topics 2 Mon Feb 17, 2020 4:45 pm
No new posts Compare 2 records of the same PS file... Twinkle22 COBOL Programming 10 Fri Jan 31, 2020 3:25 pm
No new posts Need information on creating dynamic ... grvdeshmukh0 CLIST & REXX 8 Thu Jan 16, 2020 1:55 pm

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