<?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: Program running differently is interactive versus batch mode. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681215#M206032</link>
    <description>&lt;P&gt;Oh, good call,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;.&amp;nbsp; I didn't even look at the contents of the macro itself.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, certain things like macro variables differ environment to environment.&amp;nbsp; For program name, EG as I recall has a macro variable, _CLIENTTASKLABEL.&amp;nbsp; I think I usually use&amp;nbsp;%SYSFUNC(GETOPTION(sysin) for batch submitted SAS programs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The suggestions I originally made might be helpful for a macro problem, but that's not the issue here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2020 04:14:59 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2020-09-03T04:14:59Z</dc:date>
    <item>
      <title>Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681202#M206026</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the start of my program, I am using the&amp;nbsp;options sasautos = ('C:\CommonCode\Macros&lt;SPAN style="font-family: inherit;"&gt;' sasautos);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;and then calling in the macro %gpath;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;options sasautos = ('C:\CommonCode\Macros' sasautos);&lt;/P&gt;
&lt;P&gt;%gpath;&lt;BR /&gt;%include "&amp;amp;path\setup.sas";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once I have the path from %gpath I use the macro variable in an %include to run setup.sas .&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;%include&amp;nbsp;"&amp;amp;path\setup.sas";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS interactive windows mode everything runs smoothly. In batch&amp;nbsp; the &amp;amp;path. value is not getting captured outside the macro.&lt;/P&gt;
&lt;P&gt;I get an error %include&amp;nbsp;file \setup.sas not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I am declaring the path variable as global, I don't understand why it is not working in batch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The %gpath macro runs fine but it writes the values of the variables twice to the log window.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PATH= C:\Template\Study\Dev&lt;BR /&gt;PGM= test&lt;BR /&gt;PATH= C:\Template\Study\Dev&lt;BR /&gt;PGM= test&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro gpath;&lt;/P&gt;
&lt;P&gt;%global&amp;nbsp; Path Pgm; &lt;BR /&gt;&lt;BR /&gt;%let PATH= %substr(%sysget(SAS_EXECFILEPATH),1,%length(%sysget(SAS_EXECFILEPATH))-%length(%sysget(SAS_EXECFILENAME))-1);&lt;BR /&gt;%let PGM = %substr(%sysget(SAS_EXECFILENAME),1,%length(%sysget(SAS_EXECFILENAME))-4);&lt;BR /&gt;&lt;BR /&gt;%put PATH= &amp;amp;PATH;&lt;BR /&gt;%put PGM= &amp;amp;PGM;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;BR /&gt;%gpath;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can someone help me understand why the batch program is not reading the macro variable and why the in the log&amp;nbsp; the put statement is written&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;twice?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;KC.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 02:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681202#M206026</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2020-09-03T02:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681203#M206027</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3443"&gt;@Kc2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hmm.&amp;nbsp; Sounds like a tricky one.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you add the following options statement and re-run both?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTIONS&amp;nbsp;MAUTOLOCDISPLAY;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm wondering if maybe a different autocall hierarchy exists in one environment vs. the other.&amp;nbsp; If so, you might be getting different versions of the gpath macro and therefore differing behaviors.&amp;nbsp; We should eliminate this possibility before digging further.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp; It might be helpful for you to post the relevant sections of the SAS logs from both versions.&amp;nbsp; Something funny is going on.&amp;nbsp; You may be executing slightly different versions of your program or slightly different versions of the macro.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you could also run this code for both environments and see if there are any differences:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC OPTIONS	OPTION=AUTOEXEC;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Sep 2020 02:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681203#M206027</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-03T02:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681212#M206030</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3443"&gt;@Kc2&lt;/a&gt;&amp;nbsp; - The explanation for your issue is here:&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1ns5wvyfxbca8n1l3konj0yj6nq.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p1ns5wvyfxbca8n1l3konj0yj6nq.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The environment variables you are using in %SYSGET are only available when using the Enhanced Editor running on Windows. They aren't available in batch mode. An alternative approach for batch mode is provided in the link.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 03:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681212#M206030</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-03T03:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681215#M206032</link>
      <description>&lt;P&gt;Oh, good call,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;.&amp;nbsp; I didn't even look at the contents of the macro itself.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, certain things like macro variables differ environment to environment.&amp;nbsp; For program name, EG as I recall has a macro variable, _CLIENTTASKLABEL.&amp;nbsp; I think I usually use&amp;nbsp;%SYSFUNC(GETOPTION(sysin) for batch submitted SAS programs.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The suggestions I originally made might be helpful for a macro problem, but that's not the issue here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 04:14:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681215#M206032</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-03T04:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681219#M206035</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp; - I learnt from finding this answer too!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 05:03:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681219#M206035</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-03T05:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681302#M206062</link>
      <description>&lt;P&gt;This does not solve my problem&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to automatically get the path of the program (one folder above the program) and the program name.&lt;/P&gt;
&lt;P&gt;The %sysfunc(getoption(SysIn)) gives the full path of the program program:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;log statement&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;29 options sasautos = ('C:\CommonCode\Macros' sasautos);&lt;BR /&gt;30 &lt;BR /&gt;31 %gpath;&lt;BR /&gt;The current program is &lt;FONT color="#000000"&gt;C:\Template\Study\Dev&lt;/FONT&gt;\test.sas&lt;BR /&gt;The current program is C:\Template\Study\Dev\test.sas&lt;BR /&gt;32&lt;BR /&gt;33 %include "&amp;amp;path\setup.sas";&lt;BR /&gt;WARNING: Physical file does not exist, C:\setup.sas.&lt;BR /&gt;ERROR: Cannot open %INCLUDE file \setup.sas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the interactive mode the macro variable &lt;FONT color="#0000FF"&gt;&amp;amp;path.&lt;/FONT&gt; resolves to &lt;FONT color="#0000FF"&gt;C:\Template\Study\Dev&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;When used in the %include statement %include "&lt;FONT color="#0000FF"&gt;&amp;amp;path\&lt;/FONT&gt;setup.sas"; it reads &lt;FONT color="#0000FF"&gt;C:\Template\Study\Dev&lt;/FONT&gt;\setup.sas and runs the Setup.sas program&lt;/P&gt;
&lt;P&gt;In batch I need to find a way for the system extract from %sysfunc(getoption(SysIn)) the value of the program and the path separately&lt;BR /&gt;&amp;amp;pgm= test &lt;BR /&gt;&amp;amp;path= &lt;FONT color="#0000FF"&gt;C:\Template\Study\Dev&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt; so that when the %include statement is called the &amp;amp;path. will point to the right folder structure.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 12:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681302#M206062</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2020-09-03T12:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681430#M206112</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/3443"&gt;@Kc2&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a macro function that will return a three character abbreviation for the type of session I'm running.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;CLI = Command Line Interface (command prompt)&lt;/LI&gt;
&lt;LI&gt;SEG = SAS Enterprise Guide&lt;/LI&gt;
&lt;LI&gt;DMS = Display Manager Session ("PC SAS")&lt;/LI&gt;
&lt;LI&gt;SCS = SAS Connect Session (SAS via RSubmit)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;I then use the type of session to determine which bit of code to execute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my Autoexec.sas, I have some macro variables defined which are needed by this macro:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET Nte1 = NOTE:;
%LET Nte2 = NOTE-;
%LET Warn1 = WARN:;
%LET Warn2 = WARN-;
%LET Err1 = ERROR:;
%LET Err2 = ERROR-;
%LET sQuote =&amp;nbsp;%STR(%');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here, below is the macro if it's helpful.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*-------------------------------------------------------------------------------*/
/*	Macro:	Get_Process_Mode
/*  Author: Jim Barbour (Jim.Barbour@gmail.com)
/*	Date:	23 August 2019
/*	Info:	This is a macro function.  This macro checks the automatic macro 
/*			variable SysProcessMode and returns a three character abbreviation
/*			specifying the process mode as follows:
/*			CLI = Command Line Interface, a MS DOS Command window or .bat file.
/*			DMS = SAS Display Manager, a.k.a. "PC SAS" or "SAS for Windows".
/*			SEG	= SAS Enterprise Guide ("EG").
/*			SCS	= SAS Connect Session, code submitted via an RSUBMIT.
/*
/*			Process mode indicates how a given SAS session was instanciated, i.e..
/*			from the command line or via a .bat file (CLI), via Display Manager 
/*			(DMS), via SAS Enterprise Guide (SEG), or via an RSUBMIT (SCS).
/*-------------------------------------------------------------------------------*/
/*									CHANGE LOG
/*-------------------------------------------------------------------------------*/
/*	Name:	Jim Barbour				Date:	23 August 2019
/*	Info:	Original implementation.
/*-------------------------------------------------------------------------------*/

%MACRO	Get_Process_Mode(Override=, Debug=NO);
	%LOCAL	L_Process_Mode;
	%IF	%QUPCASE(&amp;amp;Debug)				=	YES	%THEN
		%DO;
			%PUT	&amp;amp;Nte2;
			%PUT	&amp;amp;Nte1  **************************;
			%PUT	&amp;amp;Nte2  Starting Get_Process_Mode.;
			%PUT	&amp;amp;Nte2  &amp;amp;=SysProcessMode  &amp;amp;=Override	 &amp;amp;=L_Process_Mode;
		%END;

	%IF	%BQUOTE(&amp;amp;Override)				^=	%BQUOTE()						%THEN
		%IF	%EVAL(%QUPCASE(&amp;amp;Override)	IN	CLI, DMS, SEG, SCS)				%THEN
			%DO;
				%LET	L_Process_Mode	=	%QUPCASE(&amp;amp;Override);
			%END;
		%ELSE
			%DO;
				%PUT  &amp;amp;Warn2;
				%PUT  &amp;amp;Warn2  +----------------------------------------------+;
				%PUT  &amp;amp;Warn1  | Invalid override of &amp;amp;Override in Get_Process_Mode. |;
				%PUT  &amp;amp;Warn2  +----------------------------------------------+;
				%Abort_Pgm;
				%*Set_RC(SYSCC, 4);
			%END;
	%ELSE
	%IF	%QUPCASE(&amp;amp;SysProcessMode)		=	%QUPCASE(SAS DMS Session)		%THEN
		%DO;
			%LET	L_Process_Mode		=	DMS;
		%END;
	%ELSE
	%IF	%QUPCASE(&amp;amp;SysProcessMode)		=	%QUPCASE(SAS Workspace Server)	%THEN
		%DO;
			%LET	L_Process_Mode		=	SEG;
		%END;
	%ELSE
	%IF	%QUPCASE(&amp;amp;SysProcessMode)		=	%QUPCASE(SAS Batch Mode)		%THEN
		%DO;
			%LET	L_Process_Mode		=	CLI;
		%END;
	%ELSE
	%IF	%QUPCASE(&amp;amp;SysProcessMode)		=	%QUPCASE(SAS Connect Session)	%THEN
		%DO;
			%LET	L_Process_Mode		=	SCS;
		%END;
	%ELSE
		%DO;
			%PUT  &amp;amp;Warn2;
			%PUT  &amp;amp;Warn2  +-------------------------------------------------------------+;
			%PUT  &amp;amp;Warn1  | Unknown mode of &amp;amp;squote.&amp;amp;SysProcessMode.&amp;amp;squote in Get_Process_Mode. |;
			%PUT  &amp;amp;Warn2  +-------------------------------------------------------------+;
		%END;

	%IF	%QUPCASE(&amp;amp;Debug)				=	YES								%THEN
		%DO;
			%PUT	&amp;amp;Nte2  Ending Get_Process_Mode.;
			%PUT	&amp;amp;Nte2  &amp;amp;=SysProcessMode  &amp;amp;=Override	 &amp;amp;=L_Process_Mode;
			%PUT	&amp;amp;Nte2  **************************;
		%END;

	%IF	&amp;amp;True																%THEN
		%DO;
			&amp;amp;L_Process_Mode
		%END;
%MEND	Get_Process_Mode;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then a macro like the below can be written to execute the appropriate code for a given session type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO	Get_Path(Debug=NO);
	%GLOBAL	lCmnt	Pgm	Path;

	%IF	%QUPCASE(&amp;amp;Debug)			=	YES			%THEN
		%DO;
			%PUT	&amp;amp;Nte1  Debug is on in macro &amp;amp;SysMacroName;
			%LET	lCmnt			=	;
		%END;
	%ELSE
		%DO;
			%LET	lCmnt			=	*;
		%END;

	%IF	%Get_Process_Mode			=	DMS			%THEN
		%DO;
			%LET	Path			=	%QSUBSTR(%SYSGET(SAS_EXECFILEPATH),1,%LENGTH(%SYSGET(SAS_EXECFILEPATH))-%LENGTH(%SYSGET(SAS_EXECFILENAME))-1);
			%LET	Pgm				=	%QSUBSTR(%SYSGET(SAS_EXECFILENAME),1,%LENGTH(%SYSGET(SAS_EXECFILENAME))-4);
		%END;
	%ELSE
	%IF	%Get_Process_Mode			=	SEG			%THEN
		%DO;
			%LET	Path			=	%QSYSFUNC(COMPRESS(&amp;amp;_SASPROGRAMFILE,&amp;amp;sQuote));
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Path;
			%IF	%BQUOTE(&amp;amp;Path)		=	%BQUOTE()	%THEN
				%LET	Path		=	Embedded_In_Project;
			%ELSE
				%LET	Path		=	%QSUBSTR(&amp;amp;Path, 1, %EVAL(%QSYSFUNC(LENGTH(&amp;amp;Path)) - %QSYSFUNC(INDEX(%QSYSFUNC(REVERSE(&amp;amp;Path)),\))));
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Path;
			%LET	Pgm				=	%QSYSFUNC(STRIP(%QSYSFUNC(TRANWRD(%QSYSFUNC(COMPRESS(&amp;amp;_CLIENTTASKLABEL, &amp;amp;sQuote)),.sas,))));
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Pgm;
		%END;
	%ELSE
	%IF	%Get_Process_Mode			=	CLI			%THEN
		%DO;
			%LET	Path			=	%QSUBSTR(%QSYSFUNC(GETOPTION(sysin)), 1, %EVAL(%QSYSFUNC(LENGTH(%QSYSFUNC(GETOPTION(sysin)))) - %QSYSFUNC(INDEX(%QSYSFUNC(REVERSE(%QSYSFUNC(GETOPTION(sysin)))),\))));
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Path;
			%LET	Pgm				=	%QSUBSTR(%QSYSFUNC(GETOPTION(sysin)), 1, %LENGTH(%QSYSFUNC(GETOPTION(sysin))) - 4);
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Pgm;
			%LET	Pgm				=	%SCAN(&amp;amp;Pgm, %EVAL(%QSYSFUNC(COUNT(&amp;amp;Pgm, \)) + 1), \);
			%&amp;amp;lCmnt.PUT	&amp;amp;Nte1  &amp;amp;=Pgm;
		%END;
	%ELSE
	%IF	%Get_Process_Mode			=	SCS		%THEN
		%DO;
			%LET	Path			=	Unknown;
			%LET	Pgm				=	%QSYSFUNC(STRIP(%QSYSFUNC(TRANWRD(%QSYSFUNC(COMPRESS(&amp;amp;_CLIENTTASKLABEL, &amp;amp;squote)),.sas,))));
		%END;
	%ELSE
		%DO;
			%PUT  &amp;amp;Warn2;
			%PUT  &amp;amp;Warn2  +----------------------------------------------------------+;
			%PUT  &amp;amp;Warn1  | Unknown mode of &amp;amp;squote.%Get_Process_Mode&amp;amp;squote encountered in macro Get_Path. |;
			%PUT  &amp;amp;Warn2  +----------------------------------------------------------+;
		%END;
%MEND	Get_Path;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 17:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681430#M206112</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-09-03T17:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program running differently is interactive versus batch mode.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681456#M206124</link>
      <description>&lt;P&gt;thank you Jim,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to solve my problem by using the suggestion of&amp;nbsp;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976" target="_blank"&gt;@SASKiwi&lt;/A&gt;&lt;SPAN&gt;. :&amp;nbsp;%sysfunc(getoption(sysin)) with the %substr function.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I will play with&amp;nbsp;your macro.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;SPAN&gt;&amp;nbsp;for sharing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;KC&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 18:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Program-running-differently-is-interactive-versus-batch-mode/m-p/681456#M206124</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2020-09-03T18:30:32Z</dc:date>
    </item>
  </channel>
</rss>

