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: 743 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: 1353 Location: Bamberg, Germany
|
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2159 Location: USA
|
|
|
|
Code: |
//SYSIN DD *
INREC PARSE=(%1=(STARTAT=C'.G',
ENDAT=C'.',
ENDBEFR=BLANKS,
FIXLEN=10)),
OVERLAY=(81:%1)
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(82,9,SS,EQ,C'.',
OR,83,3,ZD,NE,NUM,
OR,86,1,CH,NE,C'V',
OR,87,2,ZD,NE,NUM),
OVERLAY=(50:C'--N/A--')),
IFTHEN=(WHEN=NONE,
OVERLAY=(50:82,9))
OUTFIL BUILD=(1,80)
END
//* |
Code: |
********************************* TOP OF DATA *********************
HLQ1.HLQ2.G011V00 G011V00
HLQ1.HLQ2.HLQ3.G012V0X --N/A--
HLQ1.HLQ2.HLQ3.HLQ4.G013V00 G013V00
HLQ1.HLQ2.HLQ3.HLQ4.HLQ5.G014V0X --N/A--
HLQ1.HLQ2.HLQ3.HLQ4.HLQ5.HLQ6.G015V00 G015V00
HLQ1.HLQ2.G011V00.TAIL --N/A--
HLQ1.HLQ2.HLQ3.G012V00.TAIL --N/A--
HLQ1.HLQ2.HLQ3.HLQ4.G013V00.TAIL --N/A--
HLQ1.HLQ2.HLQ3.HLQ4.HLQ5.G014V00.TAIL --N/A--
HLQ1.HLQ2.HLQ3.HLQ4.HLQ5.HLQ6.G015V00.TAIL --N/A--
******************************** BOTTOM OF DATA ******************* |
|
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1353 Location: Bamberg, Germany
|
|
|
|
Code: |
A.B.G9999V99.G4711V00 --N/A-- |
Looks like a false negative. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2159 Location: USA
|
|
|
|
Joerg.Findeisen wrote: |
Code: |
A.B.G9999V99.G4711V00 --N/A-- |
Looks like a false negative. |
This is a case for training exercise. |
|
Back to top |
|
 |
|