Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : $LISTDSN

$LISTDSN
Lists the non-VSAM data sets and Generation Data Group (GDG) data sets of a certain level, using the z/OS Catalog Search Interface services. (C)
Invocation
CALL $LISTDSN(dsname_level, buffer_address)
 
The filter defining the levels of data sets to be returned. Contains valid TSO data set name qualifier patterns, separated by periods (‘.’). The length is 1 to 44 characters. Refer to Usage Notes below for more information.
The pointer to the first or only buffer that contains the data set names of the dsname_level. Each data set name is 1 to 44 characters long and padded with blanks. The size of each buffer is 4096 bytes and can contain up to 92 data set names. The buffers are provided by $LISTDSN.
The content of each buffer has the following format for the data set name list:
Usage Notes
Generic Filter Key
You can use a generic filter key in dsname_level. It can contain the following symbols:
A single asterisk by itself indicates that either a qualifier or one or more characters within a qualifier can occupy that position. An asterisk can precede or follow a set of characters.
A double asterisk indicates that zero or more qualifiers can occupy that position. A double asterisk cannot precede or follow any characters; it must be preceded or followed by either a period or a blank.
A single percent sign by itself indicates that exactly one alphanumeric or national character can occupy that position.
Examples
For non-VSAM data sets:
For a GDG base named DATASET.GDG containing the following entries:
and for the non-VSAM data set named DATASET.GDG.G0001V00.XYZ, the following keys return the following results:

Exceptions
 
Examples
These sets of rules lists the data set names at a certain level on the message log:

 
RULE EDITOR ===> SCROLL: P
LIST_DSN(LVL);
_ LOCAL DSNBUFF, BNEXT, DCOUNT;
_ -------------------------------------------------------------------------
_ ------------------------------------------------------------+------------
_ CALL MSGLOG('DSN_LEVEL entered: ' || LVL); ¦ 1
_ CALL $LISTDSN(LVL, DSNBUFF); ¦ 2
_ UNTIL DONE : ¦ 3
_ @MAP.ADDRESS = DSNBUFF; ¦
_ @MAP.SIZE = 4096; ¦
_ INSERT @MAP('EXTERNALRO'); ¦
_ GET HZS81_MAP_WORD(DSNBUFF); ¦
_ BNEXT = HZS81_MAP_WORD.WORD; ¦
_ GET HZS81_MAP_WORD(DSNBUFF + 4); ¦
_ DCOUNT = HZS81_MAP_WORD.WORD; ¦
_ CALL LIST_DSN1(DSNBUFF, BNEXT, DCOUNT); ¦
_ DSNBUFF = BNEXT; ¦
_ END; ¦
_ CALL ENDMSG('Press PF2 to see the data set list'); ¦ 4
_ -------------------------------------------------------------------------
_ ON ROUTINEFAIL :
_ CALL ENDMSG(RETURN_SYSMSG);

 
 
RULE EDITOR ===> SCROLL: P
LIST_DSN1(LIST, BNEXT, DCOUNT);
_
_ -------------------------------------------------------------------------
_ DCOUNT = 0; ¦ Y N N
_ BNEXT = 0; ¦ Y N
_ ------------------------------------------------------------+------------
_ CALL MSGLOG('No data set names found'); ¦ 1
_ FORALL HZS81_MAP_DSN(LIST + 8) WHERE KEY <= DCOUNT : ¦ 1 1
_ CALL MSGLOG(HZS81_MAP_DSN.DSNAME); ¦
_ END; ¦
_ SIGNAL DONE; ¦ 2 2
_ -------------------------------------------------------------------------

 
Executing the rules produces the following message log:

 
---------------------- INFORMATIONAL MESSAGE LOG ----------------------------
COMMAND ===> SCROLL ===> P
DSN_LEVEL entered: USR40.**
USR40.CLIST
USR40.CNTL
USR40.OBJSTAR.PARMS
USR40.ISPF.ISPPROF

 
See Also
The @MAP shareable tool.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved