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: 4648
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 6 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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