Date: Wed, 8 Sep 2004 10:20:29 -0400
Reply-To: Michael Raithel <RAITHEM@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Raithel <RAITHEM@WESTAT.COM>
Subject: Re: How to get GDG's # during data step
Jack Smith posted the following:
> I remembered somebody posted the same question before. But I
> searched the archive and couldn't find it. We used MVS
> OS/390. I want to create a macro variable for GDG # when
> reading each input dataset to control different input
> variables. Can somebody give me a hint?
Jack, I am not quite certain what you mean by "GDG #". If it is the
hardcore "guve number", e.g. "G0007V00", then I have an answer. You could
use the JFCB to grab the file name and take it from there. Here is how I
would do it:
INFILE FILE01 JFCB=JFCBVAR;
GDGNUM = REVERSE(SUBSTR(LEFT(REVERSE(DSNAME)),1,8));
...Other SAS Code...
Of course, you could render the code above less readable, and thus boost the
possibility of your never being outsourced, by recoding the three statements
...but, hey, what self respecting SAS programmer would do such a thing!?!?!
Jack, best of luck to you in your quest to capture GDG #'s in your SAS
I hope that this suggestion proves helpful now, and in the future!
Of course, all of these opinions and insights are my own, and do not reflect
those of my organization or my associates. All SAS code and/or methodologies
specified in this posting are for illustrative purposes only and no warranty
is stated or implied as to their accuracy or applicability. People deciding
to use information in this posting do so at their own risk.
Michael A. Raithel
"The man who wrote the book on performance"
Author: Tuning SAS Applications in the MVS Environment
Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second
Currently Writing: The Complete Guide to Creating and Using SAS Indexes
(due Summer 2005)
The generation of random numbers is too important to be left
to chance. - Robert R. Coveyou