BookmarkSubscribeRSS Feed
Musheer1
Fluorite | Level 6

Hello,

We are seeing an unexpected Status=4 return code after running a Stored Process (STP) on our SAS 9.4M7 Stored Process Server.

The process involves a user uploading a large XLSX file via the Stored Process Web App, which is then processed by PROC IMPORT and subsequently several PROC APPEND steps (using the FORCE option) to load data.

The job finishes, but the Status=4 indicates a warning/minor error. We suspect this is due to data type conversion warnings from the PROC IMPORT or PROC APPEND FORCE steps.

Could a Status=4 simply mean a WARNING occurred, or does it point to a specific server configuration issue that forces warnings to escalate to this exit code?

 

Key Log Snippet:

 

Code snippet
 
Host: 'CLTSTSASS01', OS: 'WIN', Release: '10.0', SAS Version: '9.04.01M7P08052020', Command: "E:\SASHome\SASFoundation\9.4\sas.exe" ...
...
2025-10-26T11:56:07,316 INFO [00001589] 20:rgfadmin@TEST - STP: 9: Executing F:\SASDATA\Stored_process PortfolioData_Import.sas
2025-10-26T11:56:47,822 INFO [00001589] 20:rgfadmin@ETEST - STP: 9: Execution Complete. Status=4
...
// The last executed steps show the core issue:
111 +PROC IMPORT DATAFILE="&_WEBIN_FILEREF"
112 +	DBMS=XLSX
113 +	OUT=CASHFLOW REPLACE;
114 +	GETNAMES=yes;
115 +	sheet="CASHFLOW";
116 +RUN;
...
138 +PROC APPEND BASE=LND_HIST.CASHFLOW_HIST DATA=EXIM_LND.CASHFLOW FORCE;
139 +RUN;

What is the most likely cause of a persistent Status=4 when using PROC IMPORT XLSX and PROC APPEND FORCE on an STP Server?


 

4 REPLIES 4
Musheer1
Fluorite | Level 6

Musheer1_0-1761564427084.png

stick in this status more than 24 hours

Kurt_Bremser
Super User

PROC IMPORT is notoriously unreliable with regard to structure of the imported data. Don't expect consistent results which are mandatory for a later APPEND to work flawlessly.

  • No Excel files for import; demand a text file (csv) instead
  • Read with a DATA step to get consistent structure

See Maxims 22 & 31.

Quentin
Super User

I'm not an  admin, but I know it's possible to configure logging on the stored process server so that it will capture the full log from the stored process that was run.  I would do that, then review the log to find the step that caused the warning/error. 

 

If you are seeing warnings in your log from the PROC IMPORT or PROC APPEND step, then yes that would explain the status being set to 4. It's best to correct your code to avoid those warnings.   There is also a NOWARN option which can be added to PROC APPEND to suppress warning messages.

Tom
Super User Tom
Super User

If you really must read in data from XLSX files that you then what to combine with other datasets then you must put in a step to confirm that the structure (variable names, types, lengths) of the datasets are compatible.

 

Either a step that it just checks the structure and reports the differences so you know why the process failed.

 

Or something that is smart enough to modify the structure to make it compatible.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 194 views
  • 7 likes
  • 4 in conversation