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
 
deleting records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: deleting records
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    Post subject: Re: deleting records
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    Post subject: Re: deleting records
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

Moderator Team Head


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

PostPosted: Mon Jul 25, 2005 8:02 pm    Post subject: Re: deleting records
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    Post subject: Re: deleting records
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm

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