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
 

 

Dropping Records by Date

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

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Mon Feb 27, 2012 8:18 pm    Post subject: Dropping Records by Date
Reply with quote

If i have a file that contains only a date field for example (format: YYYYMMDD in positions 1-8 -activity date) and i want to include only those records that are within the last 3 years of the current date, how would i do that ?
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Mon Feb 27, 2012 8:21 pm    Post subject:
Reply with quote

jr3011,

What is the position of date field in the file (and RECFM) from which you want to filter records? Is the date format in both the file same(YYYYMMDD)?

Thanks,
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Mon Feb 27, 2012 8:24 pm    Post subject:
Reply with quote

record format

activity date YYYMMDD position 1 thru 8

Only dealing with one file, one date field within that file.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Mon Feb 27, 2012 10:04 pm    Post subject:
Reply with quote

jr3011,
Sorry I didn't read that clearly the first time...

See if below helps... I am assuming your input is FB80.
Code:
//STEP0001 EXEC PGM=SORT                                       
//SORTIN   DD  INPUT FB/80                                     
//SORTOUT  DD  OUTPUT FB/80                                   
//SYSIN DD *                                                   
   INREC OVERLAY=(81:DATE1,89:81,8,Y4T,SUBYEARS,+3,TOGREG=Y4T)
   SORT FIELDS=COPY                                           
   OUTFIL INCLUDE=((1,8,ZD,GE,89,8,ZD),AND,                   
                   (1,8,ZD,LE,81,8,ZD)),BUILD=(1,80)           
/*                                                             
//SYSOUT DD SYSOUT=*                                           
//*       


Thanks,
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 Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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