|Date: ||Mon, 7 Oct 1996 10:18:31 -0700|
|Sender: ||"SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>|
|From: ||Bruce Rogers <gxx18300@GGR.CO.UK>|
|Organization: ||Medical IR, Glaxo Wellcome|
|Subject: ||Re: SCL Variables in Submit Blocks|
Kimberly LeBouton wrote:
> I'm downsizing an AF application from MVS to UNIX. I'm reprogramming the
> application to run on both platforms, but have run into a glitch.
> In my respective autoexecs, I have created the following macro variable.
> MVS: %let indroot="&sysjobid";
> UNIX: %let indroot='$HOME/';
> In my INIT section of my AF program, I created the following SCL variable.
> Later in my MAIN section, I have a libname allocated in a SUBMIT BLOCK.
> ... SUBMIT;
> libname graph '&indroot.graphv6.sasdata';
> Here's how the libname statement resolves.
> MVS: libname graph 'userid.graphv6.sasdata';
> UNIX: libname graph '$HOME/.graphv6.sasdata';
> I would like my UNIX statement to not include the "." after the "/".
> Can I get this SCL variable to resolve the way a macro variable would,
> without the period? The original developer wants the many, many libnames
> to stay in the submit blocks.
It seems that you want the variable to resolve differently, depending on
which machine you're on, which can't be done. To achieve the same end,
however, a conditional assignment could be performed before the libname,
dsn = 'graphv6.sasdata' ;
if index("&indroot",'/') then lib = left("&indroot") || '.' || dsn ;
else lib = left("&indroot") || dsn ;
libname graph "&lib" ;
Obviously, there are many variations of this (a better way might be to
have another variable determine the OS) but it should do what you want
as it is.