View previous topic :: View next topic
|
Author |
Message |
Amar Verma
New User
Joined: 04 Apr 2023 Posts: 1 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1308 Location: Bamberg, Germany
|
|
Back to top |
|
|
ClairVarney
New User
Joined: 24 Apr 2023 Posts: 1 Location: USA
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 725 Location: Denmark
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2588 Location: Silicon Valley
|
|
|
|
[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 |
|
|
|