Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts load and delete table through JCL wit... ram_vizag JCL & VSAM 9 Thu Feb 01, 2018 12:47 am
No new posts Historical/statistical details for me... elixir1986 TSO/ISPF 13 Wed Aug 30, 2017 9:02 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us