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: 1295
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: 720
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: 2569
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 Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts Mainframe Dataset Binary or ASCII Mainframe Interview Questions 4
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top