Hi All,
I have a requirement where I need to code REXX program giving input as PDS library(which will be JCLlib) and for each member how many DD statement it has
and there corresponding file names and for each step which program is used . I need output report. Can someone help.?
Thank you
REXX Code to find if PDS JCL member has how many DD
-
- Posts: 2
- Joined: Tue Sep 14, 2021 10:55 am
- Skillset: COBOL, JCL , DB2, VSAM
- Referer: Google
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: REXX Code to find if PDS JCL member has how many DD
I choose to assume that your problem is with reading the members..
A couple of possibilities springs to mind.
- combine all members to one sequential dataset using i.e. program PDSPRINT from file 316 at http://www.cbttape.org, then parse the dataset.
- do a TSO LISTDS .. MEMBERS then do your own ALLOCATE and EXECIO to read each member for parsing.
- use the following REXX pgm DOALL to run an edit macro to do the actual parse.
A couple of possibilities springs to mind.
- combine all members to one sequential dataset using i.e. program PDSPRINT from file 316 at http://www.cbttape.org, then parse the dataset.
- do a TSO LISTDS .. MEMBERS then do your own ALLOCATE and EXECIO to read each member for parsing.
- use the following REXX pgm DOALL to run an edit macro to do the actual parse.
Code: Select all
/* rexx
Run an edit macro against all members of a library
Adapted from DOALL from Lionel B. Dyck
*/
arg dsn exec . /* libraryname and editmacro name */
/* libname must be the full name, quotes are optional */
dsn=requote(dsn)
x = outtrap("lm.","*")
"LISTD" dsn "MEMBERS"
x = outtrap("off")
do i = 1 to lm.0 while lm.i<>'--MEMBERS--'
end
dsn=unquote(dsn)
do n = i+1 to lm.0
parse value lm.n with mem .
Address ISPEXEC "EDIT DATASET('"dsn"("mem")') MACRO("exec")"
end
exit
Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'"
Unquote: return strip(space(translate(arg(1)," ","'")))
-
- Posts: 2
- Joined: Tue Sep 14, 2021 10:55 am
- Skillset: COBOL, JCL , DB2, VSAM
- Referer: Google
Re: REXX Code to find if PDS JCL member has how many DD
My requirement is :
I need to fetch below details for each JCL in pds member.
For each step
Program
DD name
Dataset
I need to fetch below details for each JCL in pds member.
For each step
Program
DD name
Dataset
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: REXX Code to find if PDS JCL member has how many DD
I see, so are new to REXX and don't know how to parse a text?
You have to read the manual, specifically the POS and SUBSTR functions, and the PARSE command for starters.
What have you done so far?
I'll give you a sample, looking for a DDname in string text.n:
if left(text.n,2)='//' & word(text.n,2)='DD' then ddname=substr(word(text.n,1),3)
You have to read the manual, specifically the POS and SUBSTR functions, and the PARSE command for starters.
What have you done so far?
I'll give you a sample, looking for a DDname in string text.n:
if left(text.n,2)='//' & word(text.n,2)='DD' then ddname=substr(word(text.n,1),3)
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: REXX Code to find if PDS JCL member has how many DD
You also need to take into account:
0) maybe, some members are not JCL at all?
1) either a member has JOB statement(s) in it, or not?
2) maybe, a single member has multiple JOBs inside of it? (This is possible, though not used too often)
3) maybe, there are internal JCL PROCedures as part of any job?
4) maybe, the member itself is an external JCL procedure?
5) maybe, some JOB/EXEC/DD/PROC statements are obsolete, and just commented out with //*?
6) maybe, there are concatenated DD statements (e.g. formal DD looking as no-name statements)?
7) maybe, some good-looking JCL sequences are coded as input stream, e.g. between // DD DATA, and /* ?
8) many other tricks and gimmicks are possible.
As for myself, I would create a flat listing of the library (using an utility like IEBPTPCH, or SUPERC, or any other available), end then would produce a regular report grouped by member/job/step/DD - using one of SORT utilities. The creation of a correct hierarchical report in REXX would require some experience in programming. While using SORT utility, much less experience may be needed.
0) maybe, some members are not JCL at all?
1) either a member has JOB statement(s) in it, or not?
2) maybe, a single member has multiple JOBs inside of it? (This is possible, though not used too often)
3) maybe, there are internal JCL PROCedures as part of any job?
4) maybe, the member itself is an external JCL procedure?
5) maybe, some JOB/EXEC/DD/PROC statements are obsolete, and just commented out with //*?
6) maybe, there are concatenated DD statements (e.g. formal DD looking as no-name statements)?
7) maybe, some good-looking JCL sequences are coded as input stream, e.g. between // DD DATA, and /* ?
8) many other tricks and gimmicks are possible.
As for myself, I would create a flat listing of the library (using an utility like IEBPTPCH, or SUPERC, or any other available), end then would produce a regular report grouped by member/job/step/DD - using one of SORT utilities. The creation of a correct hierarchical report in REXX would require some experience in programming. While using SORT utility, much less experience may be needed.
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: REXX Code to find if PDS JCL member has how many DD
abhilashanaik wrote:My requirement is :
I need to fetch below details for each JCL in pds member.
For each step
Program
DD name
Dataset
Don’t be so rude re-assigning to others the task you are supposed to do, and which you are (highly likely) paid for?
Demonstrate that you are able to do at least a minor first step by yourself, before begging for help.
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Code conversion issue while reading JCL using REXX
by vsgurunath » Fri Jun 19, 2020 10:19 pm » in CLIST & REXX - 11
- 4304
-
by vsgurunath
View the latest post
Thu Jun 25, 2020 4:08 pm
-
-
- 7
- 5216
-
by sergeyken
View the latest post
Fri Nov 13, 2020 1:24 am
-
-
transferring file from pc to mainframe pds member
by valeca » Wed Sep 28, 2022 3:42 am » in TSO & ISPF - 5
- 3352
-
by Pedro
View the latest post
Thu Sep 29, 2022 12:11 am
-
-
-
FTP dataset member with Arabic letters
by Mahmoud Anwer » Sat May 29, 2021 6:37 pm » in Simulators & Emulators - 1
- 3764
-
by enrico-sorichetti
View the latest post
Sat May 29, 2021 11:57 pm
-
-
- 0
- 1221
-
by rossburnett
View the latest post
Tue May 23, 2023 3:19 am