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
 

 

Clear the contents of a dataset

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

New User


Joined: 18 May 2007
Posts: 30
Location: CHENNAI

PostPosted: Tue Aug 28, 2007 4:08 pm    Post subject: Clear the contents of a dataset
Reply with quote

Hi all,

I want to know how to empty the dataset with out deleting it using JCL's.
Suggest me some answers please.

Thanks in advance,
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Tue Aug 28, 2007 4:14 pm    Post subject: Reply to: Clear the contents of a dataset
Reply with quote

Try This,

Code:
//*THIS JOB IS USED TO CREATE EMPTY DATASET OR EMPTY DATA IN A DATASET
//STEP1 EXEC PGM=IEBGENER                                             
//SYSUT1 DD DUMMY                                                     
//SYSUT2 DD DSN=<dataset name>,           
//         DISP=SHR                                                   
//SYSPRINT DD SYSOUT=*                                                 
//SYSIN DD *                                                           
  GENERATE MAXFLDS=2                                                   
/*                                                                     
//SYSOUT  DD SYSOUT=*                                                 
//*                     
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 Aug 28, 2007 4:22 pm    Post subject: Reply to: Clear the contents of a dataset
Reply with quote

Code:

//EMPTY    EXEC PGM=SORT
//SORTIN   DD   DISP=SHR,DSN=<dataset>
//SORTOUT  DD   DISP=SHR,DSN=<dataset>
//SYSOUT   DD   SYSOUT=*
//SYSIN    DD   *
  OPTION COPY
  OMIT COND=ALL
/*
Back to top
View user's profile Send private message
shamsundar_mk

New User


Joined: 18 May 2007
Posts: 30
Location: CHENNAI

PostPosted: Tue Aug 28, 2007 8:02 pm    Post subject: Reply to: Clear the contents of a dataset
Reply with quote

Thanks... it is working.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Sep 03, 2007 10:20 pm    Post subject:
Reply with quote

Or read the file using COBOL & don't write anything into it, give your output file DSN with DISP=OLD.

Sometimes mainframes behaves just amazing, no. of ways to do the same thing. icon_smile.gif
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Sep 03, 2007 11:27 pm    Post subject:
Reply with quote

Another option is to use IDCAMS REPRO with COUNT(0).

O.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Sep 04, 2007 1:22 am    Post subject:
Reply with quote

ofer71 wrote:
Another option is to use IDCAMS REPRO with COUNT(0).

O.


Hi Ofer.......could also be IDCAMS with input-DD DUMMY
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Sep 04, 2007 10:56 am    Post subject:
Reply with quote

If you want to clear a dataset using IDCAMS REPRO, allocate it to both input and output.

O.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 05, 2007 1:36 pm    Post subject:
Reply with quote

Hi,

Emptying a DSN using IDCAMS, one way:

Code:
//JS00100  EXEC PGM=IDCAMS                             
//DDDMMY   DD DUMMY                                     
//DDOUT    DD DSN=HLQ.FIRST.FILE,
//               DISP=OLD                                 
//SYSIN    DD *                                         
  REPRO IFILE(DDDMMY) OFILE(DDOUT)                     
//SYSPRINT DD SYSOUT=*                                 
//SYSOUT   DD SYSOUT=*                                 
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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
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


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