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

Copy from VSAM to PS and empty VSAM file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Tue Feb 17, 2009 5:42 pm
Reply with quote

Hi,

I want to copy all the records from input VSAM file to ouput PS file. After copying i want to delete all the records in input VSAM file.

I tried the below job. But afer copying the records to output PS file, records are still present in input VSAM file.

Code:

//STEP010  EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//INPUT DD DSN=INPUT.VSAM.FILE,DISP=SHR
//OUTPUT DD DSN=MY.PS.OUTPUT.FILE,
//            DISP=(,CATLG,DELETE),SPACE=(CYL,(500,500),RLSE)
//            RECFM=FB,LRECL=200
//TOOLIN   DD *
  COPY FROM(INPUT) USING(CTL1)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUTPUT,REMOVECC,
    OUTREC=(1:1,200)
  OUTFIL FNAMES=INPUT,OMIT=ALL
/*


Please provide me the solution.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 17, 2009 5:57 pm
Reply with quote

You either need to delete the records programatically or to delete / define the cluster
Back to top
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 123
Location: Hyderabad

PostPosted: Tue Feb 17, 2009 6:03 pm
Reply with quote

Is there any other way to achieve my requirement other than going to program.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 17, 2009 6:06 pm
Reply with quote

IDCAMS?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 18, 2009 12:25 am
Reply with quote

bhaskar_kanteti,

Your VSAM cluster must be defined with REUSE inorder to use it as input as well as output. here is a job which will give you the desired results assuming that your vsam cluster is defined with REUSE

Code:

//**********************************************************   
//* THIS STEP MAKES A BACKUP COPY OF THE VSAM FILE         *   
//**********************************************************   
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=INPUT.VSAM.FILE,
//            DISP=SHR                                         
//SORTOUT  DD DSN=MY.PS.OUTPUT.FILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(500,500),RLSE)
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
//*                                                           
//**********************************************************   
//* THIS STEP EMPTIES THE INPUT VSAM FILE                  *   
//**********************************************************   
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//DFSPARM  DD *                                               
  OPTION VSAMIO,RESET                                         
//SORTIN   DD DSN=INPUT.VSAM.FILE,
//            DISP=SHR                                         
//SORTOUT  DD DSN=INPUT.VSAM.FILE,                         
//            DISP=SHR                                         
//SYSIN    DD *                                               
  SORT FIELDS=(1,1,CH,A)                                       
  OMIT COND=ALL                                               
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top