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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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