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

Build dataset list with properties using HLQ in Assembler


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amar Verma

New User


Joined: 04 Apr 2023
Posts: 1
Location: India

PostPosted: Tue Apr 04, 2023 1:43 pm
Reply with quote

Hello friends,

How can I build a list of datasets using a High-level Qualifier (HLQ) in Assembler?

Lets say I need to build a list of dataset with qualifiers as : ABC*.*
The list can have any kind of dataset, e.g, PS, GDG etc. How can we achieve this in IBM Assembler?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Tue Apr 04, 2023 2:03 pm
Reply with quote

See https://www.ibm.com/docs/en/zos/2.4.0?topic=catalogs-catalog-search-interface-users-guide
Back to top
View user's profile Send private message
ClairVarney

New User


Joined: 24 Apr 2023
Posts: 1
Location: USA

PostPosted: Mon Apr 24, 2023 12:38 pm
Reply with quote

To create a list of data sets using a high-level qualifier (HLQ) in IBM Assembler, you can use the IDCAMS macro.

Here's an example of creating a list of data sets with the HLQ ABC*.*:


//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('ABC*.*')
/*
In this example, we're using the LISTCAT command to retrieve a list of all data sets matching the HLQ ABC*.*. The results will be printed to the SYSPRINT output.

You can also customize the output parameters, such as filtering the list for specific types of data sets using the ENTRYTYPE parameter.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Apr 24, 2023 9:42 pm
Reply with quote

That is not a macro, that is a utility program. As Joerg stated you have to use the catalog search interface.
But one wonders why it has do be done in assembler? There are easier methods, like the IDCAMS utility or ISPF LMDDISP and others. IBM has even supplied a sample of how to use CSI with REXX, see SYS1.SAMPLIB(IGGCSIRX).
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon May 29, 2023 7:26 am
Reply with quote

[quote] one wonders why it has do be done in assembler?/quote]

'In assembler' is somewhat vague. If I was doing this, I would set up and call ISPF LMDDISP from assembler, rather than use catalog search interface, for the following reasons:

1. I have never used CSI.

2. The topic says 'data set list with PROPERTIES'. I do not believe the catalog has all of the properties. To use CSI, you would have to get the data set names then do further interrogation for each data set, perhaps with dynamic allocation - information retrieval. LMDDISP will give you the properties, IIRC.

My second choice would be to use assembler to call a rexx routine and have it list the ds names and use the LISTDSI builtin function to get the properties.
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top