Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us