| Date: | Thu, 5 Jun 2008 10:31:31 -0700 |
| Reply-To: | =?KOI8-R?B?SsVucyBNwXJ0aW4gU2NobMF0dMVy?=
<KmoEfrUewEbx@SPAMMOTEL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | =?KOI8-R?B?SsVucyBNwXJ0aW4gU2NobMF0dMVy?=
<KmoEfrUewEbx@SPAMMOTEL.COM> |
| Organization: | http://groups.google.com |
| Subject: | Re: raise an error if libname fails? |
|
| Content-Type: | text/plain; charset=ISO-8859-1 |
> For the first test, if you want to control the libref assignment in a
> data step, then I find this logic (not tested on MVS) fairly useful:
>
> data _null_ ;
> input libref $8. datasetname $60. ;
>
> rc=libname(trim(libref),trim(datasetname)); /* Add MVS specific
> options if needed */
> if rc ne 0 then do something appropriate for your environment ; end ;
>
> call execute('libname '||trim(libref)||' list;'); /* List library DSN
> properties to SAS log */
> datalines:
> libref1 datasetname1
> libref2 datasetname2
> etc.
> ;
> run ;
You are right, this looks good!
|