IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Clear the contents of a dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: Canada

PostPosted: Tue Aug 28, 2007 4:14 pm
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

Global Moderator


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

PostPosted: Tue Aug 28, 2007 4:22 pm
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
Reply with quote

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

Superior Member


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

PostPosted: Mon Sep 03, 2007 10:20 pm
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: 2358
Location: Israel

PostPosted: Mon Sep 03, 2007 11:27 pm
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: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Sep 04, 2007 1:22 am
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: 2358
Location: Israel

PostPosted: Tue Sep 04, 2007 10:56 am
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

Superior Member


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

PostPosted: Wed Sep 05, 2007 1:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top