Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy from VSAM to PS and empty VSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 120
Location: USA

PostPosted: Tue Feb 17, 2009 5:42 pm    Post subject: Copy from VSAM to PS and empty VSAM file
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: 8593
Location: Back in jolly old England

PostPosted: Tue Feb 17, 2009 5:57 pm    Post subject:
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: 120
Location: USA

PostPosted: Tue Feb 17, 2009 6:03 pm    Post subject: Reply to: Copy from VSAM to PS and empty VSAM file
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 17, 2009 6:06 pm    Post subject:
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    Post subject:
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    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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 0 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us