Skip to content

Instantly share code, notes, and snippets.

@rkoopmann
Created April 10, 2015 03:15
Show Gist options
  • Save rkoopmann/21c0d7dce9c231d550da to your computer and use it in GitHub Desktop.
Save rkoopmann/21c0d7dce9c231d550da to your computer and use it in GitHub Desktop.
A little snippet for creating a bat file to provide a titlebar name for SAS
%let location=%sysget(sasroot)\sas.exe ;
%let config=%sysfunc(getoption(CONFIG));
%let client=;
*&TRN is a full path for a given client directory. it is standard structure for ALL clients.;
data _null_;
re=prxparse('/.*Clients\\(.+?)\\.*/');
if prxmatch(re, "&TRN") then do;
client=prxposn(re, 1, "&TRN");
put client;
call symput('client', trim(client));
end;
else put "The string 'Clients' not found in &TRN";
run;
data _null_;
file "%userprofile%\desktop\SAS - &CLIENT..bat";
put "start """" ""&LOCATION"" -CONFIG ""&CONFIG"" -AWSTITLE=""&CLIENT""";
put "exit";
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment