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
 
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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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