MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Split files thru Syncsort - Failing

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Oct 15, 2004 1:27 pm    Post subject: Reply with quote

Ravi ,

Quote:

All the records less than 2004150 should be moved to another file (FILE2)


If I understand your question correctly, you need to DELETE all the records in the vsam file if the date is less than 2004150. Is that right?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Oct 15, 2004 2:20 pm    Post subject: Reply with quote

Ravi,

The following JCl will give you the desired results. We first copy contents of the vsam file to a BACKUP dataset and the records to be deleted to the DELETE dataset. Now we concatenate this 2 datasets and eliminate dups. So we use the SELECT operator with NODUPS option to eliminate all the records to be deleted. Note that the out vsam dataset is same as the input dataset. You can use the same input vsam file as output vsam file when it is defined with REUSE option.


Code:

//******************************************************************
//* THIS STEP WILL DELETE RECORDS IN AN EXISTING VSAM CLUSTER      *
//******************************************************************
//STEP0100 EXEC PGM=SYNCTOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//VSAMIN   DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=SHR                                   
//DELETE   DD DSN=YOUR DELETE FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)       
//BACKUP   DD DSN=YOUR BACKUP FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)       
//CON      DD DSN=YOUR DELETE FILE,
//            DISP=SHR,VOL=REF=*.DELETE 
//         DD DSN=YOUR BACKUP FILE,
//            DISP=SHR,VOL=REF=*.BACKUP
//OUT      DD DSN=YOUR INPUT VSAM FILE,         
//            DISP=OLD                                   
//TOOLIN   DD *                   
   COPY FROM(VSAMIN) USING(CTL1)
   SELECT FROM(CON) TO(OUT) ON(1,9,CH) NODUPS       
//DFSPARM  DD *                                     
   OPTION VSAMIO,RESET         
//CTL1CNTL DD *
   OUTFIL FNAMES=DELETE,INCLUDE=(1,7,CH,LE,C'2004150')
   OUTFIL FNAMES=BACKUP 
/*                                                 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Oct 15, 2004 4:53 pm    Post subject: Reply with quote

ravi,

You can use the same input vsam file as output vsam file when it is defined with REUSE option.

I am suspecting that your vsam file allocated with reuse=no

If you have file-aid at your shop then allocate a new cluster with REUSE=YES and try running the job I posted.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group