IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT -- Relative date checking


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts DFSORT Join Keys Controlcard DFSORT/ICETOOL 4
No new posts Sort card to know that creation date ... DFSORT/ICETOOL 10
No new posts Help with SORT - I need to validate d... DFSORT/ICETOOL 11
No new posts Date format correction using dfsort DFSORT/ICETOOL 3
Search our Forums:


Back to Top