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
 
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: 4650
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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