LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 2 May 2002 22:33:26 +0200
Reply-To:   Lex jansen <lex@LEX-JANSEN.DEMON.NL>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Lex jansen <lex@LEX-JANSEN.DEMON.NL>
Organization:   Posted via Supernews, http://www.supernews.com
Subject:   Re: x command: quotes
Content-Type:   multipart/alternative;

This is a multi-part message in MIME format.

------=_NextPart_000_001E_01C1F229.605D9050 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

RE: x command: quotesThanks jack & Matt,

I Agree with reverend Jack's (church of the holy quote) sermon. I was gonna do some WSH scripting, but needed a quick V612 to V82 = upgrade.

This worked for me:

%let sascmd=3D%sysfunc(sysget(sasroot))\sas.exe;

%DO i =3D 1 %TO &nprog; X """&sascmd"" -nosplash -nologo -icon -sysin ""&&prog&i"""; %END;

SASROOT and Prog's can have blanks. (Now I have to convince my users not to use '&'s, '%'s , '('s and ')'s = in their file names, otherwise I have to do a little more macro = quoting.)

Btw. today there was a question on SAS-L that was very much alike. It helped me too.

Lex

"Shoemaker, Jack" <shoe@STATPROBETECHNOLOGIES.COM> wrote in message = news:5145D2B03DFAD111B7AD0008C79F78EAAB4136@NC-MAIL... <SERMON ON>=20 SAS is not a scripting language. You should build a script in your = language of choice: Perl, Python, WNT Scripting, instead of trying to = make SAS do this.

<SERMON OFF>=20

To solve your problem, try something like this (untested <g>)=20

For example=20

%macro sas;=20 %sysfunc(sysget(sasroot))\sas.exe -NOSPLASH -NOLOGO -ICON -SYSIN=20 %mend sas;=20

%DO i =3D 1 %TO &nprog;=20 X %sas "&&prog&i";=20 %END;=20

-----Original Message-----=20 From: Lex jansen=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: 5/1/02 3:14 PM=20 Subject: x command: quotes=20

I'm struggling with my quotes.=20 I have a macro that reads names of programs from a text file and then=20 submits all these programs one after the other.=20

something like:=20

%LET sas=20 %sysfunc(sysget(sasroot))\sas.exe -NOSPLASH -NOLOGO -ICON -SYSIN;=20

And then in a loop I would do:=20

%DO i =3D 1 %TO &nprog;=20 X "&sas &&prog&i";=20 %END;=20

However, since I went from 6.12 to 8.2 the SASROOT has blanks,=20 because it is installed in C:\Program Files\SAS Institute\SAS\V8.=20 That is where the X command breaks.=20 I tried many combinations.=20 Of course I could do: X "C:\PROGRA~1\SASINS~1\SAS\V8 &&prog&i=20

But that is not neat.=20

There has to be a simple solution.=20

Thanks,=20

Lex Jansen=20

------=_NextPart_000_001E_01C1F229.605D9050 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>RE: x command: quotes</TITLE> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 5.50.4915.500" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Thanks jack &amp; Matt,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>I Agree with&nbsp;reverend Jack's = (church of the=20 holy quote) sermon.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>I was gonna do some WSH scripting, but = needed a=20 quick V612 to V82 upgrade.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>This worked for me:</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>%let=20 sascmd=3D%sysfunc(sysget(sasroot))\sas.exe;<BR></FONT></DIV> <DIV><FONT face=3DArial size=3D2>%DO i =3D 1 %TO = &amp;nprog;</FONT></DIV> <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; X = """&amp;sascmd""=20 -nosplash -nologo -icon -sysin ""&amp;&amp;prog&amp;i""";</FONT></DIV> <DIV><FONT face=3DArial size=3D2>%END;<BR></DIV></FONT> <DIV><FONT face=3DArial size=3D2>SASROOT and Prog's can have = blanks.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>(Now I have to convince my users not to = use=20 '&amp;'s, '%'s ,&nbsp;'('s and ')'s in their file names, otherwise I = have to do=20 a little more macro quoting.)</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Btw. today there was a question on = SAS-L that was=20 very much alike.</FONT></DIV> <DIV><FONT face=3DArial size=3D2>It helped me too.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Lex</DIV></FONT> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV>"Shoemaker, Jack" &lt;<A=20 = href=3D"mailto:shoe@STATPROBETECHNOLOGIES.COM">shoe@STATPROBETECHNOLOGIES= .COM</A>&gt;=20 wrote in message <A=20 = href=3D"news:5145D2B03DFAD111B7AD0008C79F78EAAB4136@NC-MAIL">news:5145D2B= 03DFAD111B7AD0008C79F78EAAB4136@NC-MAIL</A>...</DIV> <P><FONT size=3D2>&lt;SERMON ON&gt;</FONT> <BR><FONT size=3D2>SAS is = not a=20 scripting language.&nbsp; You should build a script in your language = of=20 choice: Perl, Python, WNT Scripting, instead of trying to make SAS do=20 this.</FONT></P> <P><FONT size=3D2>&lt;SERMON OFF&gt;</FONT> </P> <P><FONT size=3D2>To solve your problem, try something like this = (untested=20 &lt;g&gt;)</FONT> </P> <P><FONT size=3D2>For example</FONT> </P> <P><FONT size=3D2>%macro sas;</FONT> <BR><FONT=20 size=3D2>%sysfunc(sysget(sasroot))\sas.exe&nbsp; -NOSPLASH&nbsp; = -NOLOGO&nbsp;=20 -ICON&nbsp; -SYSIN </FONT><BR><FONT size=3D2>%mend sas;</FONT> </P> <P><FONT size=3D2>%DO i =3D 1 %TO &amp;nprog;</FONT> <BR><FONT=20 size=3D2>&nbsp;&nbsp;&nbsp; X %sas "&amp;&amp;prog&amp;i";</FONT> = <BR><FONT=20 size=3D2>%END;</FONT> </P> <P><FONT size=3D2>-----Original Message-----</FONT> <BR><FONT = size=3D2>From: Lex=20 jansen</FONT> <BR><FONT size=3D2>To: SAS-L@LISTSERV.UGA.EDU</FONT> = <BR><FONT=20 size=3D2>Sent: 5/1/02 3:14 PM</FONT> <BR><FONT size=3D2>Subject: x = command:=20 quotes</FONT> </P> <P><FONT size=3D2>I'm struggling with my quotes.</FONT> <BR><FONT = size=3D2>I have=20 a macro that reads names of programs from a text file and then</FONT>=20 <BR><FONT size=3D2>submits all these programs one after the = other.</FONT> </P> <P><FONT size=3D2>something like:</FONT> </P> <P><FONT size=3D2>%LET sas</FONT> <BR><FONT=20 size=3D2>%sysfunc(sysget(sasroot))\sas.exe&nbsp; -NOSPLASH&nbsp; = -NOLOGO&nbsp;=20 -ICON&nbsp; -SYSIN;</FONT> </P> <P><FONT size=3D2>And then in a loop I would do:</FONT> </P> <P><FONT size=3D2>%DO i =3D 1 %TO &amp;nprog;</FONT> <BR><FONT=20 size=3D2>&nbsp;&nbsp;&nbsp; X "&amp;sas &amp;&amp;prog&amp;i";</FONT> = <BR><FONT=20 size=3D2>%END;</FONT> </P> <P><FONT size=3D2>However, since I went from 6.12 to 8.2 the SASROOT = has=20 blanks,</FONT> <BR><FONT size=3D2>because it is installed in = C:\Program=20 Files\SAS Institute\SAS\V8.</FONT> <BR><FONT size=3D2>That is where = the X=20 command breaks.</FONT> <BR><FONT size=3D2>I tried many = combinations.</FONT>=20 <BR><FONT size=3D2>Of course I could do: X = "C:\PROGRA~1\SASINS~1\SAS\V8&nbsp;=20 &amp;&amp;prog&amp;i</FONT> </P> <P><FONT size=3D2>But that is not neat.</FONT> </P> <P><FONT size=3D2>There has to be a simple solution.</FONT> </P> <P><FONT size=3D2>Thanks,</FONT> </P> <P><FONT size=3D2>Lex Jansen</FONT> </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_001E_01C1F229.605D9050--


Back to: Top of message | Previous page | Main SAS-L page