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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am

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