View previous topic :: View next topic
|
Author |
Message |
stevetelo
New User
Joined: 09 Jan 2025 Posts: 1 Location: USA
|
|
|
|
Hello, I am looking for a suggestion to develop the below (by using JCL, REXX or COBOL etc).
My requirement is -
I will get a generic GDG dataset name as input
Example: HLQ1.HLQ2.HLQ3.G001V00 or HLQ1.HLQ2.G015V00
(so basically GDG can be of 2 high level qualifier or 3 or 4 or 5)
And the process should be able to tell me the GDG base name
Example HLQ1.HLQ2.HLQ3 or HLQ1.HLQ2 etc
Need expert advise |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10891 Location: italy
|
|
|
|
just a POC ...
not checking if the format of dsname provided is right
last seven bytes ...
letter G
three digits
letter V
two digits
Code: |
/* REXX */
gdg.0 = 2
gdg.1 = "HLQ1.HLQ2.HLQ3.G001V00"
gdg.2 = "HLQ1.HLQ2.G015V00"
do i = 1 to gdg.0
say i "base:"left(gdg.i,length(gdg.i)-8)", gen:"right(gdg.i,7)
end
exit
|
to get ...
Code: |
1 base:HLQ1.HLQ2.HLQ3, gen:G001V00
2 base:HLQ1.HLQ2, gen:G015V00
|
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 740 Location: Denmark
|
|
|
|
Not pure REXX, but have a a look at RXREALDS at harders-jensen.com
cc=RxRealDs(name,[nft])
name Relative gds or alias. Gdsrel may be positive like (+1).
The name is internally upcased and quotes are removed.
nft Returned text if name is not found. Default is a null string
The text is returned asis, not upcased.
Returns
Real name if such exists. Note that this could be the 'name' value
if the name is already the real name.
null or the nft value if name cannot be located. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1348 Location: Bamberg, Germany
|
|
Back to top |
|
|
|