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 a PDS member in a particular Volume.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
srajendran

New User


Joined: 25 Sep 2006
Posts: 22

PostPosted: Fri Oct 13, 2006 3:54 pm    Post subject: Deleting a PDS member in a particular Volume.
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    Post subject: Re: Deleting a PDS member in a particular Volume.
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: 22

PostPosted: Wed Oct 18, 2006 8:21 pm    Post subject:
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: 22

PostPosted: Wed Feb 28, 2007 6:41 pm    Post subject:
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    Post subject: Re: Deleting a PDS member in a particular Volume.
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: 22

PostPosted: Wed Feb 28, 2007 7:24 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Mar 01, 2007 11:54 am    Post subject:
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: 22

PostPosted: Thu Mar 01, 2007 3:33 pm    Post subject: Thanks everyone....
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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