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
 

 

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: 4649
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 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
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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