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
 

 

DFSORT to split records older than 2007.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT to split records older than 2007.
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    Post subject: Reply to: DFSORT to split records older than 2007.
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    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 get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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