BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

Hello,

I have asked my manager to create a new sub environment on the development server.

I have run a SAS program using the options mprint mlogic source2; and the only things that I see into the log file is some warning.

 

Usually, for  this kind of message (warning) we are suppose to get done(1) instead of exit 1.

 

Any idea how to solve that kind of issue  or to bring the system behaviour as it was before

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

I get the impression that you are running this program as a batch job. If that is true and you are using the sasbatch script file then you need to ensure that line checking for a return code of 1 is as shown in this version:

@echo off
REM /*--------------------------------------------------------------------\
REM |                                                                     |
REM | Script for managing the SAS DATA Step Batch Server                  |
REM |                                                                     |
REM \--------------------------------------------------------------------*/

REM Define needed environment variables
call "%~dp0..\appservercontext_env.bat"
call "%APPSERVER_ROOT%\BatchServer\sasbatch_usermods.bat"

Set CONFIGDIR=%APPSERVER_ROOT%\BatchServer
if not {"%username%"}=={""} (
Set CMD_OPTIONS=-noxwait -noxcmd -lrecl 32767 -config "%CONFIGDIR%\sasv9.cfg" -sasinitialfolder "%APPSERVER_ROOT%" %USERMODS_OPTIONS%
) else (
Set CMD_OPTIONS=-sasuser work -noxwait -noxcmd -lrecl 32767 -config "%CONFIGDIR%\sasv9.cfg" -sasinitialfolder "%APPSERVER_ROOT%" %USERMODS_OPTIONS%
)

"%SAS_COMMAND%" %CMD_OPTIONS% %*%
REM remove the REM from the statements below to capture exit=1 (SAS warning) and make it exit=0
set rc=%ERRORLEVEL% 
if %rc%==1 goto makenormalexit 
exit /b %rc% 
:makenormalexit 
exit /b 0 

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

As a minimum show the log with the "some warning" and the code that generates the warning.

 

Since you mention setting macro debug options then you may have to investigate the macro code. If a macro is defined with the SECURE option you may have difficulty getting the debug options to work.

SASKiwi
PROC Star

I get the impression that you are running this program as a batch job. If that is true and you are using the sasbatch script file then you need to ensure that line checking for a return code of 1 is as shown in this version:

@echo off
REM /*--------------------------------------------------------------------\
REM |                                                                     |
REM | Script for managing the SAS DATA Step Batch Server                  |
REM |                                                                     |
REM \--------------------------------------------------------------------*/

REM Define needed environment variables
call "%~dp0..\appservercontext_env.bat"
call "%APPSERVER_ROOT%\BatchServer\sasbatch_usermods.bat"

Set CONFIGDIR=%APPSERVER_ROOT%\BatchServer
if not {"%username%"}=={""} (
Set CMD_OPTIONS=-noxwait -noxcmd -lrecl 32767 -config "%CONFIGDIR%\sasv9.cfg" -sasinitialfolder "%APPSERVER_ROOT%" %USERMODS_OPTIONS%
) else (
Set CMD_OPTIONS=-sasuser work -noxwait -noxcmd -lrecl 32767 -config "%CONFIGDIR%\sasv9.cfg" -sasinitialfolder "%APPSERVER_ROOT%" %USERMODS_OPTIONS%
)

"%SAS_COMMAND%" %CMD_OPTIONS% %*%
REM remove the REM from the statements below to capture exit=1 (SAS warning) and make it exit=0
set rc=%ERRORLEVEL% 
if %rc%==1 goto makenormalexit 
exit /b %rc% 
:makenormalexit 
exit /b 0 

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1419 views
  • 0 likes
  • 3 in conversation