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

Copy records into two files based on dates


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Fri Feb 20, 2009 9:29 am
Reply with quote

Hi,
I have data in a file with some date values. like
20090105
20090117
20090125
20090206
20090215
20090224

The records which are <=1 to 15 of the month should be copied into file-1 and the records which are > 15 to (30 or 31) should be copied to file-2.
can u pls help me on this?

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

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Feb 20, 2009 9:38 am
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
20090105                                               
20090117                                               
20090125                                               
20090206                                               
20090215                                               
20090224                                               
//OUT1     DD SYSOUT=*                                 
//OUT2     DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION COPY                                           
  OUTFIL FNAMES=OUT1,INCLUDE=(07,2,ZD,LE,15)           
  OUTFIL FNAMES=OUT2,SAVE                               



Gerry
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 52

PostPosted: Fri Feb 20, 2009 10:11 am
Reply with quote

Thanks gcicchet. My requiremnt is solved.
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 Write line by line from two files DFSORT/ICETOOL 7
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top