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

deleting records


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
keerthi

New User


Joined: 23 Mar 2005
Posts: 25

PostPosted: Mon Jul 25, 2005 2:21 pm
Reply with quote

I faced this question in an interview. Please let me know if anybody knows the answer.

Without deleting the dataset i want to delete only the records from the dataset using JCL.

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

New User


Joined: 18 Jul 2005
Posts: 15

PostPosted: Mon Jul 25, 2005 3:14 pm
Reply with quote

you can acheive this by using the utility ZEMPTY(if your mainframe supportes the utility)

you need to code ur jcl like this

//step1 exec pgm=zempty
//z1 dd dsn=dataset name,disp=shr

this will delete all the records in the provided dataset

Hope this helps u............
Back to top
View user's profile Send private message
raghavendraun

New User


Joined: 29 Apr 2005
Posts: 9

PostPosted: Mon Jul 25, 2005 7:01 pm
Reply with quote

Hi keerthi,

Here is another Example,

//STEP01 exec pgm=iebgener
//sysprint dd sysout=*
//sysut1 dd dummy,
// dcb=(blksize=800,lrecl=80, recfm=fb)
//sysut2 dd dsb=Your-Dataset,
// disp=shr
//sysin dd dummy

Regards,
Raghavendra U N
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Jul 25, 2005 8:02 pm
Reply with quote

Using SORT:

Code:

//STEP0001 EXEC PGM=SORT                                 
//SORTIN   DD   DISP=SHR,DSN=MY.DATASET
//SORTOUT  DD   DISP=SHR,DSN=MY.DATASET
//SYSOUT   DD   SYSOUT=*                                 
//SYSIN    DD   *                                         
  OPTION COPY                                             
  OMIT COND=ALL                                           
//*                                                       
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Wed Jul 27, 2005 11:49 am
Reply with quote

Hi friend

use
repro indataset(dataset1) outdataset(dataset2)

dataset1--------empty dataset

so after repro dataset2 will also be empty


Regards
prasad
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Deleting a Tape file JCL & VSAM 14
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top