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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: JCL to delete the last 6 lines of all the members in a PDS
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: 2360
Location: Israel

PostPosted: Tue Feb 21, 2006 3:08 pm    Post subject:
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    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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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