IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL/REXX to know GDG base name


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
stevetelo

New User


Joined: 09 Jan 2025
Posts: 1
Location: USA

PostPosted: Fri Jan 10, 2025 8:53 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10891
Location: italy

PostPosted: Fri Jan 10, 2025 9:58 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 740
Location: Denmark

PostPosted: Fri Jan 10, 2025 10:24 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1348
Location: Bamberg, Germany

PostPosted: Sat Jan 11, 2025 4:22 pm
Reply with quote

See also https://ibmmainframes.com/about69543.html how to do it with a SORT.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
Search our Forums:

Back to Top