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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
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 split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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