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
 
Empty a VSAM KSDS dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Tue Jan 26, 2010 8:31 pm    Post subject: Empty a VSAM KSDS dataset
Reply with quote

Hi, I am trying to empty a VSAM data set in below way but its not working
Code:
//STEP070  EXEC PGM=IDCAMS                         
//SYSPRINT DD  SYSOUT=*                             
//IN1      DD  DUMMY                               
//OUT1     DD  DSN=ABCD.DDDD.TEST,DISP=OLD   
//SYSIN    DD  *                                   
 REPRO  INFILE(IN1),OUTFILE(OUT1)                   
//*                                                 


Can anyone tel me is there any way.
Back to top
View user's profile Send private message

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Tue Jan 26, 2010 8:39 pm    Post subject:
Reply with quote

How is it "not working"?
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Tue Jan 26, 2010 8:52 pm    Post subject:
Reply with quote

Well not sure.. I have the same code written but the VSAM file has the same OLD data.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Tue Jan 26, 2010 9:02 pm    Post subject:
Reply with quote

I find that DELETE / DEFINE is the best way to do this.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Tue Jan 26, 2010 9:17 pm    Post subject:
Reply with quote

Once a record has been written to a VSAM file, the only way to get rid of that record is to delete it -- via IDCAMS, or via a program. The method of copying from DD DUMMY to the file, which works for sequential files, fails for VSAM files.
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 Jan 26, 2010 9:59 pm    Post subject:
Reply with quote

Has the dataset been defined with the optional REUSE parameter?
REUSE
Specifies that the cluster can be opened again and again as a reusable cluster. When a reusable cluster is opened, its high-used RBA is set to zero if you open it with an access control block that specifies the RESET attribute.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Tue Jan 26, 2010 10:20 pm    Post subject: Reply to: Empty a VSAM KSDS dataset
Reply with quote

This is a method using DFSORT.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Tue Jan 26, 2010 10:41 pm    Post subject:
Reply with quote

so does it means if its defined with Optional REUSE parameter then only the above code will work ?
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 Jan 26, 2010 10:50 pm    Post subject:
Reply with quote

Frank Yaeger in Delete all records from KSDS wrote:
If the VSAM data set is defined for REUSE, I believe this DFSORT job will do what you want:

Code:

//SORTSTP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SS5661.G5661.INTAS.TST3.PDIQUEUE,DISP=SHR
//SORTOUT DD DSN=SS5661.G5661.INTAS.TST3.PDIQUEUE,DISP=SHR
//SYSIN DD *
   RECORD TYPE=V
   OPTION VSAMIO,RESET
   OMIT COND=ALL
   SORT FIELDS=(5,1,BI,A)
/*
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Wed Jan 27, 2010 1:07 am    Post subject:
Reply with quote

will it work for VSAM files?
My requirement is for VSAM file
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 27, 2010 1:19 am    Post subject:
Reply with quote

Quote:
will it work for VSAM files?
My requirement is for VSAM file
Did you not read the quote?
Quote:
If the VSAM data set is defined for REUSE, I believe this DFSORT job will do what you want:
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm

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