View previous topic :: View next topic
|
Author |
Message |
mubashir.surury
New User
Joined: 29 Sep 2005 Posts: 23 Location: Pune
|
|
|
|
Hi Everyone,
I have a PDS with member containing JCL's.My reqquirement is to that I need the Jobname(in Jobcard) to be same as the Member name in which it exists.the member list is dynamic and has to be fetched on the run time.
Can you tell me whether this can be done and if yes can you give me the Logic as to how it can be done.My doubt is how can I read all the members 1 by 1 and edit them on my way.
Regards,
Mubashir.
A ship in harbor is safe; but that is not what ships are built for |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
REXX might be a great solution.
First, you need to read the members, and you can do that using:
1. LISTDS command, and OUTTRAP the output.
2. LMMLIST service of ISPF.
3. Read the PDS directory.
Then, for each member issue the ISPF service EDIT, with the MACRO parameter.
Create an edit macro that retrieves the member name using the MEMBER command, and then read the JOB card using LINE commands.
O. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What process creates the dynamic jcl members? Might that process be modified so that when a new member is created, it has the correct jobname in it? If that is done, there would be no need to put the correct jobname in later. |
|
Back to top |
|
|
mubashir.surury
New User
Joined: 29 Sep 2005 Posts: 23 Location: Pune
|
|
|
|
Hi,
What we have is a REXX routine to which we define a default Jobcard to use for generating all the JCL's.What Dick says is probably the best solution.But would be a tedious one to implement as that routine is a widespread one and To change that would require Business approval.What we do is submit those member JCl's after changing the Jobname as member name.So what i want to do is implement this routine on a local basis and later on if reqd then may be the main routine itself can be updated.
ofer71,
thanks for ur prompt reply.
Regards,
Mubashir |
|
Back to top |
|
|
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
What SUBMITs the jobs?
What is the jobcard defined in? A skeleton?
Are they all submitted at once by a batch or online process or spasmodically, manually by one or more users? |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
I have a REXX named RXPDS000 to do what I need to all members of a PDS.
Code: |
/* REXX routine uses 2 parameters: pds name & subroutine name */
/* The subroutine is called for each member of the pds - passing */
/* the pds and member names to perform the subroutine function */
/* Example to list all members of a pds: */
/* RXPDS000 ISC.PROD.DB2.SQLLIB RXPDSL00 */
/* Author: Douglas Wilder */
Parse Upper Arg fromdsn func rest
Say fromdsn ' ' func
If 0<>listdsi("'"fromdsn"'") then
Do
Say 'Data set 'fromdsn' not allocated'
Exit
End
If 'PO'<>substr(sysdsorg,1,2) then
Do
Say 'Data set 'fromdsn' is not a pds'
Exit
End
"ALLOC F(AREAD) DS('"fromdsn"') SHR REUSE DSORG(PS) LRECL(256) RECFM(F B)"
'EXECIO * DISKR AREAD ( FINIS STEM DIRS.'
'FREE F(AREAD)'
Do blocknum = 1 to dirs.0
block=dirs.blocknum
Parse Var dirs.blocknum bl 3 block
block=substr(block,1,c2d(bl)-2)
Do While block<>''
Parse Var block mbrname 9 ttr 12 c 13 block
c=c2d(bitand(c,'1f'x))
If mbrname='FFFFFFFFFFFFFFFF'x then
Leave blocknum
mbrname=strip(mbrname)
func fromdsn mbrname rest
If RC <> 0 then Exit(RC)
block=delstr(block,1,c*2)
End
If RC <> 0 then
Do
Say "RC passed from function: " RC
End
End
Exit(RC)
|
The REXX PDSJobNm to read the PDS member, change all //JOBNAME to the member name and write out the member is as follows:
Code: |
/*Rexx PDSJobNm to change the job name to match PDS member name. */
/*called from RXPDS000 */
/*Example: TSO RXPDS000 XXXXXXX.X.X PDSJobNm */
/* Author: Douglas Wilder */
Parse Upper Arg dsname name rest
oldval = "//JOBNAME"
newval = "//"||name
/* READ USING ARRAY */
FROM_NAME = "'"DSNAME"("NAME")'"
"ALLOCATE DDNAME(INFILE) SHR DSNAME(" FROM_NAME ")"
"EXECIO * DISKR INFILE (STEM RECD. FINIS"
HOW_MANY = RECD.0
/* CHANGE OLDVAL TO NEWVAL */
do c = 1 to how_many
strt = pos(oldval,recd.c)
do while strt > 0
ln = left(recd.c,strt-1)||newval||substr(recd.c,strt+length(oldval))
recd.c = ln
strt = pos(oldval,recd.c)
end
end c
/* WRITE USING ARRAY */
"EXECIO " HOW_MANY " DISKW INFILE (STEM RECD. FINIS"
"FREE DDNAME(INFILE)"
Exit
|
Change the //JOBNAME in this REXX to whatever jobname is in your JCL.
To execute these REXXs with the following command:
TSO RXPDS000 XXXXXXX.X.X PDSJobNm
where XXXXXXX.X.X is the DSN of your PDS.
The first REXX will call the second REXX for each member of the PDS.
I believe that this will fit your needs. Note: this REXX can be run online or batch.
[/code] |
|
Back to top |
|
|
|