Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DFSORT -- Relative date checking

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Jim C

New User


Joined: 26 Sep 2012
Posts: 1
Location: US

PostPosted: Thu Sep 27, 2012 12:47 am    Post subject: DFSORT -- Relative date checking
Reply with quote

Hi

I have an input file to a sort with a date format of mm/dd/yy starting in position 7 to 14. (Sample below)

XXXXX 09/25/12 14:53:03 TEXT MESSAGE

I want to include only records where the date is within 30 days of the current date. I tried reviewing the other posts but I was not able to find out how to handle a date in this format. Do I need to reformat it first?
Thank you in advance for your help
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 27, 2012 1:16 am    Post subject: Reply to: DFSORT -- Relative date checking
Reply with quote

Jim C,

You need to transform the date and compare it against system date. Use the following DFSORT JCL which will give you the desired results. I assumed that your input lrecl=80 and recfm=fb
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
XXXXX 08/25/12 14:53:03 DROP                           
XXXXX 09/26/12 14:53:03 PICK                           
XXXXX 08/28/12 14:53:03 PICK                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  INREC OVERLAY=(81:7,8,UFF,ZD,LENGTH=6)               
  OUTFIL BUILD=(1,80),INCLUDE=(81,6,Y2W,GT,Y'DATE1'-30)
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us