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

Dropping Records by Date


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 577
Location: USA

PostPosted: Mon Feb 27, 2012 8:21 pm
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
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: 577
Location: USA

PostPosted: Mon Feb 27, 2012 10:04 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top