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

JCL to delete the last 6 lines of all the members in a PDS


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

New User


Joined: 03 Jan 2006
Posts: 3

PostPosted: Tue Feb 21, 2006 2:37 pm
Reply with quote

I need a JCL to delete the last 6 lines of all the members in a PDS.

The PDS is having almost 900 members and we need to delete the last 6 lines from all the members
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Feb 21, 2006 3:08 pm
Reply with quote

Try this:

Create a REXX edit-macro, and call it 'DEL6'. Here is the code:
Code:
/* REXX */                                   
                                             
ADDRESS ISREDIT "MACRO PROCESS"               
                                             
ADDRESS ISREDIT "(LASTL) = LINENUM .ZLAST"   
LASTL6 = LASTL - 6                           
                                             
ADDRESS ISREDIT "DELETE "LASTL6 LASTL         
ADDRESS ISREDIT "END"                         
                                             
EXIT                                         


Run the following REXX to invoke the DEL6 macro against each member of the PDS.
Code:

/* REXX */                                                             
                                                                       
ARG PDS .                                                               
                                                                       
PDS = STRIP(PDS,"B","'")                                               
                                                                       
X = OUTTRAP("LIBMEM.")                         /* Trap output of TSO  */
 ADDRESS TSO "LISTDS '"PDS"' M"                                         
X = OUTTRAP("OFF")                                                     
                                                                       
DO I = 7 TO LIBMEM.0                                                   
  LIBMEM.I = STRIP(LIBMEM.I)                   /* Member name         */
  ADDRESS ISPEXEC "EDIT DATASET ('"PDS"("LIBMEM.I")') MACRO (DEL6)"     
  SAY I RC LIBMEM.I                                                     
END                                                                     
                                                                       
EXIT                                                                   
                                                                       


O.
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts I need a 4 lines block where substrin... DFSORT/ICETOOL 12
Search our Forums:

Back to Top