<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Customize SAS invocation command in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617524#M18019</link>
    <description>&lt;P&gt;We don't want to set up multiple servers.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 17:04:47 GMT</pubDate>
    <dc:creator>ashrivastava</dc:creator>
    <dc:date>2020-01-15T17:04:47Z</dc:date>
    <item>
      <title>Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617037#M18001</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am relatively new to SAS administration. I have installed SAS 9.3 in a Unix environment and also established connectivity with SQL Server. Now what I want to do is to customize SAS invocation command like below:-&lt;/P&gt;&lt;P&gt;SASt - Will connect to test server on SQL server&lt;/P&gt;&lt;P&gt;SASq - Will connect to QA server on SQL server&lt;/P&gt;&lt;P&gt;SASp - WIll connect to the SQL production server&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I write ./sas to invoke SAS in my environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help in this matter will be greatly appreciated.&lt;/P&gt;&lt;P&gt;Let me know if additional information is needed.&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617037#M18001</guid>
      <dc:creator>ashrivastava</dc:creator>
      <dc:date>2020-01-13T20:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617113#M18002</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298879"&gt;@ashrivastava&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of changing the default sas invocation, I would advise you to write a wrapper script and then let the wrapper invoke SAS with required customization.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 03:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617113#M18002</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2020-01-14T03:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617135#M18003</link>
      <description>&lt;P&gt;Set up separate application servers for the three contexts. Define the different library connections for the relevant servers.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 06:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617135#M18003</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-14T06:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617251#M18006</link>
      <description>&lt;P&gt;Thanks for the suggestion. Could you please explain a bit more about this wrapper script?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 17:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617251#M18006</guid>
      <dc:creator>ashrivastava</dc:creator>
      <dc:date>2020-01-14T17:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617273#M18008</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298879"&gt;@ashrivastava&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a simple wrapper script to invoke Base SAS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;#!/bin/sh -p

SASROOT=/path/to/SASFoundation/9.4
SAS_COMMAND=$SASROOT/sas

Quoteme() {
   if [ $# -gt 1 ]; then
      quoteme="\"$*\""
   else
      quoteme=$1
   fi
}

cmd="$SAS_COMMAND"

for arg in "$@" ; do
   Quoteme $arg
   tmp="$quoteme"
   cmd="$cmd $tmp"
done

eval exec $cmd&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Jan 2020 18:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617273#M18008</guid>
      <dc:creator>alexal</dc:creator>
      <dc:date>2020-01-14T18:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617365#M18016</link>
      <description>Do you use a single odbc.ini to setup all 3 sqlsrvr data sources or separate files?</description>
      <pubDate>Wed, 15 Jan 2020 03:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617365#M18016</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2020-01-15T03:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617366#M18017</link>
      <description>In this scenario, he will have to use sasbatch.sh for the configurations to load for separate app contexts. If sas binary is directly launched from foundation directory, those configurations won't be read during session launch.</description>
      <pubDate>Wed, 15 Jan 2020 03:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617366#M18017</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2020-01-15T03:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617522#M18018</link>
      <description>&lt;P&gt;Hi Anand, Thanks for the reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to use a single odbc.ini file to connect to multiple SQL servers (test, prod, and uat) and databases. We have this kind of setup in our old server but now we moved to a new server (the person who set up the old server is no longer here), where I installed SAS but unable to replicate the way we used to invoke SAS i.e. SASp for production, SASq for test etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample of an old SASd script: -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/ksh&lt;BR /&gt;. /home/sas9&lt;STRONG&gt;/sub.profile&lt;/STRONG&gt;&lt;BR /&gt;cd /home/sasapps/uat/programs&lt;/P&gt;&lt;P&gt;#initialize batch parameter constants&lt;BR /&gt;BATCHPARMS="-work /home/tmp -nonews -rsasuser"&lt;/P&gt;&lt;P&gt;nice /home/sas9/sas $BATCHPARMS -autoexec "/home/sasapps/uat/programs/&lt;STRONG&gt;autoexec.sas&lt;/STRONG&gt;" &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sub.profile: -&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.:\&lt;BR /&gt;/sybase11/bin:/home/sas9:/home/userid/utility&lt;BR /&gt;SYBASE=/sybase11&lt;BR /&gt;LIBPATH=/path/to/odbc/lib/file&lt;BR /&gt;LANG=en_US&lt;BR /&gt;ODBCHOME=/path/to/odbc&lt;BR /&gt;ODBCINI=/path/to/odbcini&lt;BR /&gt;export PATH SYBASE LIBPATH LANG ODBCHOME ODBCINI&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;autoexec.sas&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;filename senv '/path/to/sas/programs';&lt;/P&gt;&lt;P&gt;%global senvcode;&lt;BR /&gt;%global senvpath;&lt;BR /&gt;%let senvcode = %scan(%sysfunc(pathname(SENV,f)),-2,'/');&lt;BR /&gt;%let senvpath = %sysfunc(pathname(SENV,f));&lt;/P&gt;&lt;P&gt;options nonotes;&lt;BR /&gt;filename whoami pipe 'whoami';&lt;BR /&gt;data _null_;&lt;BR /&gt;infile whoami;&lt;BR /&gt;input;&lt;BR /&gt;if _infile_ eq 'poldenka' then call execute('%options_statement');&lt;BR /&gt;run;&lt;BR /&gt;options notes;&lt;/P&gt;&lt;P&gt;libname sasdata '/path/to/library/data';&lt;BR /&gt;libname saswrite '/path/to/library';&lt;/P&gt;&lt;P&gt;options sasautos=("%sysfunc(pathname(SENV,f))/sasmacro"&lt;BR /&gt;"/home2/sasapps/uat/programs/sasmacro"&lt;BR /&gt;'!SASROOT/sasautos'&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then from command line (old server) when I type commands like SASd, SASp, SASq, it invokes respective SAS and automatically connects to respective server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 17:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617522#M18018</guid>
      <dc:creator>ashrivastava</dc:creator>
      <dc:date>2020-01-15T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617524#M18019</link>
      <description>&lt;P&gt;We don't want to set up multiple servers.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 17:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/617524#M18019</guid>
      <dc:creator>ashrivastava</dc:creator>
      <dc:date>2020-01-15T17:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618020#M18027</link>
      <description>Thanks for sharing the old script. What does LIBPATH is pointing to in sub.profile file? I think it's the libname statement?</description>
      <pubDate>Fri, 17 Jan 2020 08:20:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618020#M18027</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2020-01-17T08:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618094#M18028</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298879"&gt;@ashrivastava&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am relatively new to SAS administration. I have installed SAS 9.3 in a Unix environment and also established connectivity with SQL Server. Now what I want to do is to customize SAS invocation command like below:-&lt;/P&gt;
&lt;P&gt;SASt - Will connect to test server on SQL server&lt;/P&gt;
&lt;P&gt;SASq - Will connect to QA server on SQL server&lt;/P&gt;
&lt;P&gt;SASp - WIll connect to the SQL production server&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, I write ./sas to invoke SAS in my environment.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help in this matter will be greatly appreciated.&lt;/P&gt;
&lt;P&gt;Let me know if additional information is needed.&lt;/P&gt;
&lt;P&gt;Thanks in advance...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What exactly needs to change to connect to a different server?&amp;nbsp; Do you need to run different SAS code? Set different environment variables? Set different SAS options?&amp;nbsp; Set different SQL server options?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be that all you need is three dummy scripts that just do something and then call the existing script.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might even be able to just make an alias if all you need to change is to add some command line switches.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 15:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618094#M18028</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-17T15:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Customize SAS invocation command</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618140#M18029</link>
      <description>&lt;P&gt;I think I figured it out. I changed the path in old script to point to my current and respective path and it seems to be working now as when I use SASd command it opens SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks all for responses.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 17:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Customize-SAS-invocation-command/m-p/618140#M18029</guid>
      <dc:creator>ashrivastava</dc:creator>
      <dc:date>2020-01-17T17:07:53Z</dc:date>
    </item>
  </channel>
</rss>

