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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


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