Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 3 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us