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

Deleting a PDS member in a particular Volume.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajendran

New User


Joined: 25 Sep 2006
Posts: 24

PostPosted: Fri Oct 13, 2006 3:54 pm
Reply with quote

Hi,

pls let me know how can I delete a member of a PDS in the volume 'xxxx'
Back to top
View user's profile Send private message
prakash_rc

New User


Joined: 16 Oct 2006
Posts: 1

PostPosted: Wed Oct 18, 2006 5:03 pm
Reply with quote

1. Go to option 3.4
2. Give the pds name and the volume serial also
3. The dataset is listed
4. Give e preceeding the dataset name
5. Members are listed in the dataset. Delete the member.

Regards,
Prakash
Back to top
View user's profile Send private message
srajendran

New User


Joined: 25 Sep 2006
Posts: 24

PostPosted: Wed Oct 18, 2006 8:21 pm
Reply with quote

Thnx for the reply......


How can I do this in a REXX Program???
Back to top
View user's profile Send private message
srajendran

New User


Joined: 25 Sep 2006
Posts: 24

PostPosted: Wed Feb 28, 2007 6:41 pm
Reply with quote

Any thoughts/ideas on this??
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Wed Feb 28, 2007 6:50 pm
Reply with quote

This is a REXX called EKILL. This should be stored in a valid REXX library. When you are editing a member of a PDS, you enter EKILL on the command line and it deletes the member you are in. It does not ask you to confirm, it just deletes the member.

Code:

/* REXX */                                                             
/* FOR TESTING CLRSCRN...   */                                         
TRACE "O";                                                             
ADDRESS ISREDIT "MACRO (START,LENGTH) NOPROCESS";                       
/* ------------------------------------------ */                       
/*  HERE'S WHERE WE'LL CHECK FOR TRACING!     */                       
/* ------------------------------------------ */                       
  ADDRESS ISPEXEC "CONTROL ERRORS CANCEL";                             
  PREVRC = RC;                                                         
  ADDRESS ISPEXEC "VGET (SPFDBUG) PROFILE";                             
  IF RC ?= 0 THEN  SPFDBUG = N                                         
  IF SPFDBUG = Y THEN TRACE "R";                                       
/* TRACE "I"; */                                                       
/*--------------------------------------------------------------------*/
/* SETUP ENVIRONMENT.                                                 */
/*--------------------------------------------------------------------*/
IF PARM = "HELP" 3 PARM = "HELP" THEN;                                 
   DO;                                                                 
     ADDRESS ISPEXEC "SELECT PGM(ISPTUTOR) PARM(#EKILL";               
     PREVRC = RC;                                                       
     EXIT;                                                             
     END;                                                               
/*--------------------------------------------------------------------*/
/* GET THE CURRENT DSN AND MBR...                                     */
/*--------------------------------------------------------------------*/
'ISREDIT (CURRMBR) = MEMBER';                                           
'ISREDIT (CURRDSN) = DATASET';                                         
'ISREDIT CANCEL';                                                       
/*--------------------------------------------------------------------*/
/* TRY TO DELETE THE FILE, WHETHER IT BE A MEMBER OF A PDS OR SEQ DS. */
/*--------------------------------------------------------------------*/
IF CURRMBR ?= " " THEN                                                 
    ADDRESS TSO "DELETE '"CURRDSN"("CURRMBR")'"                         
  ELSE                                                                 
    DO                                                                 
      ZEDSMSG = "INVALID DATASET"                                       
      ZEDLMSG = "DATASET MUST BE A PDS AND ONLY MEMBERS CAN BE EKILLED"
      SIGNAL ERROR_SEQ                                                 
      END;                                                             
                                                                       
RETURN (0);                                                             
/* ----------NOT A MEMBER OF A PDS----------------- */                 
ERROR_SEQ:                                                             
ADDRESS ISPEXEC "SETMSG MSG(ISRZ001)"                                   
RETURN (12);                                                           
Back to top
View user's profile Send private message
srajendran

New User


Joined: 25 Sep 2006
Posts: 24

PostPosted: Wed Feb 28, 2007 7:24 pm
Reply with quote

hmm...that s a good piece of code....

and i m sorry, that did not suit me...My requirement is , i have a DS name and the volume in which it is located. I need to delete a member in that PDS, which I dynamically get thru Batch...

Any Thoughts on this on how it can be sccompolished thru REXX??
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Mar 01, 2007 11:54 am
Reply with quote

Take a look at the LMMDEL service. LMMDEL requires a preliminary LMINIT call, which have a VOLUME parameter.

O.
Back to top
View user's profile Send private message
srajendran

New User


Joined: 25 Sep 2006
Posts: 24

PostPosted: Thu Mar 01, 2007 3:33 pm
Reply with quote

WooHoo...I got the code!!!!

Code:
"ALLOCATE FI(SYSUT1) DA('"dsname"') VOLUME("volnam") SHR"             
if rc <> 0 then                                                       
  do                                                                   
   say Return from ALLOCATE for 'dsname' in volume 'volnam' is' rc
   exit 255                                                           
  end                                                                 
"ALLOC F(SYSUT2) DA(*) REUSE"                                         
                                                                       
"ALLOC F(SYSUT3) DA(*) REUSE"                                         
"ALLOCATE F(SYSPRINT) NEW KEEP UNIT(VIO) DSORG(PS) ",                 
   "TRACKS SPACE(1,1) LRECL(121) BLKSIZE(1210) RECFM(F B) REUSE"       
 if rc <> 0 then                                                       
 do                                                                   
 say Return from ALLOCATE FOR SYSPRINT is 'rc               
 exit 255                                                             
 end                                                                   
"ALLOCATE F(SYSIN) NEW KEEP UNIT(VIO) DSORG(PS) ",                     
   "TRACKS SPACE(1,1) LRECL(80) BLKSIZE(0) RECFM(F B) REUSE"
if rc <> 0 then                                                     
 do                                                                   
 say Return from ALLOCATE FOR SYSIN is 'rc                 
 exit 255                                                             
 end                                                                 
cpy.0 = 1                                                             
cpy.1 = " SCRATCH MEMBER="member",VOL=SYSDA="volnam",DSNAME="dsname   
"EXECIO "cpy.0"  DISKW SYSIN (STEM cpy. FINIS"                       
if RC <> 0 then                                                       
   do                                                                 
   say exec_name 'Error, return from EXECIO DISKW is 'RC             
   "FREE F(SYSUT1 SYSUT2 SYSUT3 SYSPRINT SYSIN)"                     
   exit 255                                                           
   end                                                               
"CALL *(IEHPROGM)"
if rc <> 0 then                                                       
 do                                                                   
   "FREE F(SYSUT1 SYSUT2 SYSUT3 SYSPRINT SYSIN)"                     
   exit 100                                                           
 end                                         
"FREE F(SYSUT1 SYSUT2 SYSUT3 SYSPRINT SYSIN)"
return 0                                     


[/quote]
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Deleting a Tape file JCL & VSAM 14
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Volume chain using DFSORT DFSORT/ICETOOL 17
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
Search our Forums:

Back to Top