Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to list data set names with different HLQ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
murali.andaluri

New User


Joined: 07 Jun 2013
Posts: 14
Location: USA

PostPosted: Thu Apr 12, 2018 11:33 pm    Post subject: How to list data set names with different HLQ?
Reply with quote

Hi,

I am new to REXX and started writing small programs to automate few things.
I am writing a program to read SSO to find out execution time of each job.
I achieved logic by using Parse, but challenge i am facing is listing data set names. My job names starts with IS*, IF*, IB*. I cant give I* because there are huge number of jobs with it.

below is my code:
DATFILE='SSO.D*.T*' || JDATE || '.' || 'IS*'
DSVAR = ''
"ISPEXEC LMDINIT LISTID(IDV) LEVEL("DATFILE")
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"

If i use above code it is listing only jobs with IS*, but i need IF* and IB* as well, can someone help me how to achieve this?
Note: i can not use I* since there is huge list of jobs.
Back to top
View user's profile Send private message

daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 714
Location: Pennsylvania

PostPosted: Fri Apr 13, 2018 12:21 am    Post subject:
Reply with quote

What I would do is put your code in an internal subroutine.
I would have the last node be a variable.
I would call this subroutine from an earlier loop.
Example.
Note 1: This is completely untested, but a good start
Note 2: This is just one approach, go ahead guys and beat me up.

Code:
LAST_NODES. = ''
LAST_NODES.1 = 'IS'
LAST_NODES.2 = 'IF'
LAST_NODES.3 = 'IB'
X = 1
DO UNTIL LAST_NODES.X = ''
  CALL LIST_DATASETS
  X = X + 1
END

EXIT

/* SUBROUTINE */
LIST_DATASETS: NOP
LASTNODE = LAST_NODES.X
DATFILE='SSO.D*.T*' || JDATE || '.' ||LASTNODE||'*'
DSVAR = ''
"ISPEXEC LMDINIT LISTID(IDV) LEVEL("DATFILE")
DO FOREVER
"ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"
.... MORE CODE.....
RETURN
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2058
Location: UK

PostPosted: Fri Apr 13, 2018 1:24 am    Post subject:
Reply with quote

You are missing
Code:
last_nodes.0 = 3

which then allows
Code:
Do x= 1 to last_nodes.0

instead of the DO UNTIL and later you do not need LASTNODE=LAST_node.x
but have
Code:
DATFILE='SSO.D*.T*' || JDATE || '.' ||LAST_NODE.x||'*'


Just an alternative without changing too much.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2113
Location: Silicon Valley

PostPosted: Fri Apr 13, 2018 5:41 am    Post subject: Reply to: How to list data set names with different HLQ?
Reply with quote

just a comment on terminology:

The subject of the post is about HLQ, but the example is about LLQ. The high level qualifier (HLQ) is the leftmost qualifier in the data set name. The low level qualifier (LLQ) is the rightmost qualifier.
Back to top
View user's profile Send private message
murali.andaluri

New User


Joined: 07 Jun 2013
Posts: 14
Location: USA

PostPosted: Fri Apr 13, 2018 3:38 pm    Post subject:
Reply with quote

Your solution is working!!!
Thank you so much Nic.
Back to top
View user's profile Send private message
murali.andaluri

New User


Joined: 07 Jun 2013
Posts: 14
Location: USA

PostPosted: Fri Apr 13, 2018 3:42 pm    Post subject: Re: Reply to: How to list data set names with different HLQ?
Reply with quote

Sorry Pedro!!! Its typo error.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1114
Location: Oostende, Belgium

PostPosted: Fri Apr 13, 2018 3:57 pm    Post subject:
Reply with quote

Nic Clouston wrote:
You are missing
Code:
last_nodes.0 = 3

which then allows
Code:
Do x= 1 to last_nodes.0

instead of the DO UNTIL and later you do not need LASTNODE=LAST_node.x
but have
Code:
DATFILE='SSO.D*.T*' || JDATE || '.' ||LAST_NODE.x||'*'


Just an alternative without changing too much.

I've actually started using Dave's method, i.e.

Code:
s. = -1
s.1 = whatever
s.2 = something
s.3 = this?
s.4 = that?

do i = 1 by 1 while s.i \= -1
...
end

as it stops you forgetting to update s.0!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1114
Location: Oostende, Belgium

PostPosted: Fri Apr 13, 2018 3:57 pm    Post subject:
Reply with quote

Nic Clouston wrote:
You are missing
Code:
last_nodes.0 = 3

which then allows
Code:
Do x= 1 to last_nodes.0

instead of the DO UNTIL and later you do not need LASTNODE=LAST_node.x
but have
Code:
DATFILE='SSO.D*.T*' || JDATE || '.' ||LAST_NODE.x||'*'


Just an alternative without changing too much.

I've actually started using Dave's method, i.e.

Code:
s. = -1
s.1 = whatever
s.2 = something
s.3 = this?
s.4 = that?

do i = 1 by 1 while s.i \= -1
...
end

as it stops you forgetting to update s.0!
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 714
Location: Pennsylvania

PostPosted: Fri Apr 13, 2018 4:42 pm    Post subject:
Reply with quote

Nic,

I am NOT missing - last_nodes.0 = 3

I leave it off on purpose. My method allows adding more entries without having to set this value as well. I have been burned in the past.

I have used this method hundreds of times.

This is why I said this is just one method.
Back to top
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 88
Location: Stockholm, Sweden

PostPosted: Sat Apr 28, 2018 7:45 pm    Post subject: How to list data set names with different LLQ?
Reply with quote

daveporcelan wrote:
Nic,
I am NOT missing - last_nodes.0 = 3
I leave it off on purpose. My method allows adding more entries without having to set this value as well. I have been burned in the past.
I quite like it.
Alternative solution: Read the list of LLQ specifications?
Code:
"EXECIO * DISKR SYSIN (STEM last_nodes. FINIS "
and
Code:
//SYSIN   *
IS%A*
IF%B*X
IB%88*
/*
By this means one can use full member patterns?
This also sets last_nodes.0?
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 219
Location: Denmark

PostPosted: Sun Apr 29, 2018 2:44 pm    Post subject:
Reply with quote

my personal preference for small lists is using a string, like:
Code:
 list='item1 item2 item3'     
 do listn=1 to words(list)   
   call sub(word(list,listn))
 end 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to send email along with formated... wik123 JCL & VSAM 5 Thu Aug 09, 2018 9:48 am
No new posts Send data from a CICS TS program to M... spiThingy CICS 2 Wed Aug 08, 2018 8:58 am
This topic is locked: you cannot edit posts or make replies. Data Sets are files. Please stop str... jasorn JCL & VSAM 11 Wed Aug 08, 2018 1:55 am
No new posts AFP duplex page containing variable data jose angel santamaria IBM Tools 0 Wed Jul 18, 2018 12:35 pm
No new posts Utility to list Data Set Information Auryn JCL & VSAM 4 Tue Jul 17, 2018 5:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us