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
 

 

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: 1770
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: 8593
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: 8117
Location: East Dubuque, Illinois, 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: 4649
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: 8117
Location: East Dubuque, Illinois, 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 Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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