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
 

 

Sort on Date Based

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

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Wed May 06, 2009 11:57 am    Post subject: Sort on Date Based
Reply with quote

Hi,

I have an input file with 21 Millions records.

Records structure is

UNIT DATE COST
1 20090301 1$
1 20090302 1$
1 20090303 1$
1 20090304 1$
1 20090304 1$
1 20090304 1$
2 20090301 1$
2 20090401 1$
2 20090501 1$


I need to write a JCL to filter out all the records based on an input date like A Date 20090506 minus 2 weeks

Is it possible to generate the input date and use the same as filter to remove all records?

I do not have access to use ICETOOL.

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

Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Wed May 06, 2009 7:32 pm    Post subject: Re: Sort on Date Based
Reply with quote

nirmal.poikaikumaran wrote:

I do not have access to use ICETOOL.
Why do you believe this?

Also, what is the format of the date? YYYYMMDD ???
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 06, 2009 8:55 pm    Post subject: Reply to: Sort on Date Based
Reply with quote

nirmal,

If your intention is to filter out records based current date - 2 weeks then the following DFSORT will give you the desired results. Date1 is YYYYMMDD format and we are subtracting 14 days from it (20090506 - 14 = 20090422). So any record which has a date greater than 20090422 at pos 3 is written to the output.

Code:

//STEP0100 EXEC PGM=SORT           
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD *                   
1 20090301 1$                     
1 20090302 1$                     
1 20090303 1$                     
1 20090304 1$                     
1 20090304 1$                     
1 20090304 1$                     
2 20090301 1$                     
2 20090401 1$                     
2 20090501 1$                     
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                   
  SORT FIELDS=COPY                 
  INCLUDE COND=(3,8,CH,GE,DATE1-14)
/*
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 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


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