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

Need a Sort condition to omit records based on input date


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
john gresam

New User


Joined: 04 Jul 2013
Posts: 2
Location: India

PostPosted: Thu Oct 24, 2013 6:12 pm
Reply with quote

Hi All,

I have a request to drop records from my input file which has 24 months data and i need to drop the records of 24th month data from my input file and it looks like as below:

Input file:

ccyymm
201109................
201110................
201111................
201112................
......
......
201309................
201310................

from above data i need to drop records with value '201109'. If it is for one time request i can just use the omit in sort and eliminate those records, but my job runs every month so next month when my job runs it should remove '201110' value records and so on......

Please anyone suggest the sort condition for this using syncsort
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Thu Oct 24, 2013 6:21 pm
Reply with quote

Try this job:

Code:
//STEP01   EXEC PGM=SORT                     
//SORTIN   DD *                               
201109                                       
201110                                       
201111                                       
201112                                       
201309                                       
201310                                       
//SORTOUT  DD SYSOUT=*                       
//SYSOUT   DD SYSOUT=*                       
//SYSIN    DD *                               
 OPTION COPY                                 
 OUTFIL OMIT=(1,6,CH,LT,DATE2-24),BUILD=(1,6)
/*                                           

Output:
Code:
201110
201111
201112
201309
201310
Back to top
View user's profile Send private message
john gresam

New User


Joined: 04 Jul 2013
Posts: 2
Location: India

PostPosted: Thu Oct 24, 2013 10:18 pm
Reply with quote

Thanks mistah kurtz . It worked. icon_smile.gif
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Oct 25, 2013 11:15 am
Reply with quote

You're welcome :-)
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top