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

DFSORT to split records older than 2007.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
smaru

New User


Joined: 22 Oct 2008
Posts: 49
Location: India

PostPosted: Sat Feb 14, 2009 12:19 am
Reply with quote

All,
I have a requirement . There is a file containing records from date 2000-02-09 to 2008-02-09.Is there a way through DFSORT to check the date parameter ? If so, my requirement is to remove all records less than 2007-02 ( year - 1) from one file and write those out to another.
It could be a weird question , but if anyone could help me that would be great.

Thanks in advance.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Feb 14, 2009 1:55 am
Reply with quote

when you say year-1 did you mean current date - 1 year? You are already in 2009 , so year -1 would be 2008-02. If that is the case the following JCL will give you the desired results. Date2(-) is of the format YYYY-MM

so current YYYY-MM - 12 = 2009-02 - 12 = 2008-02

Code:

//STEP0100 EXEC PGM=ICEMAN         
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD *                   
2000-02-09                         
2001-03-05                         
2007-02-09                         
2007-06-09                         
2008-01-09                         
2008-03-10                         
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                   
  SORT FIELDS=COPY                 
  OMIT COND(1,7,CH,LT,DATE2(-)-12)
/*



The output from the above job
Code:

2008-03-10   
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 How to split large record length file... DFSORT/ICETOOL 10
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top