MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

inserting a new line into all members of a pds

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Sat Jun 21, 2003 4:48 am    Post subject: inserting a new line into all members of a pds Reply with quote

Hi all,

I need to insert a line for e.g.
//*THIS IS THE FIRST LINE OF THE MEMBER'

in all the members of a pds.

Can someone tell how can we do this in rexx.

Thanks,
deepesh
Back to top
View user's profile Send private message AIM Address
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sat Jun 21, 2003 7:50 pm    Post subject: Reply with quote

I'd do this in 2 stages. First create an edit macro that inserts the new line, and then create a routine that will invoke the edit macro against all the members.

The edit macro would be something like :-

ADDRESS ISREDIT
"MACRO"
nline = "//THIS IS THE FIRST LINE F THE MEMBER"
"LINE_AFTER 0 = (NLNE)"
"END"
"MEND"

The routine to invoke the edit macro agaianst all members would use LM services to extract the member list. LMINIT, followed by LMOPEN then a loop uisng LMMLIST, with the LIST option, to obtain the current member. For each member use the EDIT service to invoke the edit macro. At the end of the loop use the FREE option of LMMLIST, then LMCLOSE and finally LMFREE.
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Sun Jun 22, 2003 6:34 pm    Post subject: Reply with quote

I have a utility which can run an edit macro against specified members of a PDS/PDSE. It can do this online or via a batch job that is dynamically generated basing the JCL on the allocatons of the invoker.

The utilisty consists of 4 componenets. The initiaing Rexx program WKMADV2, a panel WKMP0100, a message member WKMM00 and another Rexx program that actually does the main processing (this can be invoked directly with the appropriate parameters).

You could just use the WKMX0100 program on it's ow, it requires 3 parameters (a 4th optional parameter is allowed (consisting of everything given after the third parameter), the contenets of which is placed into the ISPF SHARED pool (variable name is WRKMPARM) which can then be extracted, by the edit macro, from the SHARED pool via a VGET). The parameters are :-
1) The name of the edit macro to be invoked for each member.
2) The member mask that determines the members to be selected (uses standard ISPF mask characters).
3) The name of the PDS to be processed.


Here's the componenets :-

The WKMADV2 Rexx program (Place this in a library that will be allocated to either SYSEXEC or SYSPROC).
[code:1:b6716059f0]
/* Rexx - WKMADV2 */
/*--------------------------------------------------------------------*/
/* Run and edit macro against a number of members in either batch */
/* or foreground. */
/* This is basically the same as WKM, although instead of creating */
/* the batch job according to a skeleton it dynamically creates the */
/* JCL and sends is to the internal reader based upon the datasets */
/* that are currently allocated to ddnames ISPMLIB, ISPSLIB, ISPPLIB */
/* ISPTLIB, SYSPROC & SYSEXEC. Note that it alllocates ddnames */
/* ISPPROF and ISPTABL to a system generated dataset using UNIT=SYSDA */
/* Therefore this has the advantage the no on-site tailoring (other */
/* than setting the job card in the panel) should be required. */
/* */
/*--------------------------------------------------------------------*/
WKMADV:
ADDRESS "ISPEXEC"
Do Forever
"DISPLAY PANEL(WKMP0100)"
If Rc > 0 Then Leave
cmd = "WKMX0100 "macro memsel pds wkmparm
If mode = "F" Then x = wkmemf(memsel macro pds)
If mode = "B" Then x = wkmemb(memsel macro pds)
End
Exit

WKMEMB:
profVOL = "UNIT=SYSDA,SPACE=(TRK,(1,1,1)),"
profdcb = "DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160,DSORG=PO)"
logvol = "UNIT=SYSDA,SPACE=(CYL,(10,1)),"
logdcb = "DCB=(RECFM=VBA,LRECL=125,BLKSIZE=0)"
ADDRESS TSO "ALLOC F(INTRDR) RECFM(F) LRECL(80) SYSOUT(A) ",
"WRITER(INTRDR)"
j.1 = jcl1
j.2 = jcl2
j.3 = jcl3
j.4 = "//STEP010 EXEC PGM=IKJEFT01,REGION=0M"
j.0 = 4
x = DDCPY("ISPMLIB ISPSLIB ISPPLIB ISPTLIB SYSPROC SYSEXEC ")
k = j.0 + 1
j.k = "//SYSPRINT DD SYSOUT=*"
k= k + 1
j.k = "//SYSTSPRT DD SYSOUT=*"
k = k + 1
j.k = "//ISPPROF DD "||profvol
k = k + 1
j.k = "// "||profdcb
k = k + 1
j.k = "//ISPTABL DD "||profvol
k = k + 1
j.k = "// "||profdcb
k = k + 1
j.k = "//ISPLOG DD "||logvol
k = k + 1
j.k = "// "||logdcb
k = k + 1
j.k = "//SYSTSIN DD *"
k = k + 1
j.k = " ISPSTART CMD("cmd")"
ADDRESS TSO "EXECIO * DISKW INTRDR (STEM j. FINIS"
ADDRESS TSO "FREE F(INTRDR)"
submsg = "A Batch Job has been submitted
"SETMSG MSG(WKMM000A)"
Return 0

WKMEMF:
ADDRESS TSO cmd
Return 0

DDCPY: Parse Upper Arg ddnames
x = Outtrap("DDLIST.","*")
ADDRESS TSO "LISTA ST SYSNAMES"
x = Outtrap("OFF")
dd_not_reqd = 0
dd_reqd = 1
dd_concat = 2
cur_mode = dd_not_reqd
k = j.0
Do i = 1 to ddlist.0
l = i + 1
If Substr(ddlist.l,1,2) = " " Then Do
If Substr(ddlist.l,3,8)
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Wed Jun 25, 2003 5:10 am    Post subject: Reply with quote

Thanks mike for your solution it helped me to insert line into pds members
Back to top
View user's profile Send private message AIM Address
deepeshk79
Beginner


Joined: 20 Jun 2003
Posts: 112
Topics: 48
Location: Bangalore

PostPosted: Tue Jul 01, 2003 8:42 am    Post subject: Reply with quote

Thanks mike,

Ur solution did work fine for me.

Deepesh
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group