><HTML><PRE>Subject: MVS/TSO LISTDS 'DSLIST' LEVEL->SAS
>From: "Dwight M. Buffum" <dmbuffum@SESAME.HEALTHPARTNERS.COM>
>Date: Wed, Sep 23, 1998 17:00 EDT
>Hi, SAS-Lers. Would somebody tell me how to get a list of MVS dataset
>names into a DATA step by specifying the appropriate high level
>qualifiers? For example, from within an MVS batch SAS job, I want to
>specify 'LYMANM.F001.DEC.DEMOGRAP' and get back all the MVS dataset
>names with that prefix, e.g.,
>so I can parse and analyze them in a DATA step.
>Of course, I can get that list in ISPF from panel 3.4 and manually do
>what I want. I can get the list of dataset names along with additional
>data about the datasets by submitting the following TSO command.
>LISTDS 'LYMANM.F001.DEC.DEMOGRAP' LEVEL
>Is there a way to 'capture' the results of this TSO command in a flat
>file that I can read in a DATA step?
>Thanks in advance.
One way is to use LISTC LEVEL(.....) with the OFILE option. TSO HELP LISTC will
give you the syntax details.
You can also capture a specified number of lines using REXX or CLISTs.