BookmarkSubscribeRSS Feed
EddieR333
Fluorite | Level 6

Problem:

 

When running program via SAS EG there are no errors.

 

However, when I use this code in Putty (Linux):

 

/opt/sas/sashome/SASFoundation/9.4/sas /FileStore/TU_DataMI/Testing/Edward/Quote_Warehouse/Project/Program_v3/NEW_DIM_RISK.sas -log /FileStore/ed_log.log

 

I receive I/O error on: 'proc sort data=stg.policy_names; by varnum; run;'

 

I have tested with other programs and I am receiving various errors.

 

Is there something I am missing, in terms of a system option I should be using?

 

Thanks in advance.

21 REPLIES 21
Kurt_Bremser
Super User

My first guess would be that the workspace server behind EG uses a dedicated volume for WORK, while the basic sasv9.cfg in SASFoundation/9.4 uses the default /tmp. And you run out of disk space there.

 

Instead of running SAS in batch like you do, use SASCONF/Lev1/SASApp/BatchServer/sasbatch.sh (or the BatchServer/sasbatch.sh in the directory of the application server context you use in EG)

EddieR333
Fluorite | Level 6
Hi Kurt,

Thank you for taking the time to help me with this (and the quick response).

I'm not 100% sure I am following. Could you confirm for me:

Instead of using:
/opt/sas/sashome/SASFoundation/9.4/sas *PROGRAM*

I could try:
/opt/sas/config/Lev1/SASApp/BatchServer/sasbatch.sh *PROGRAM*

Kurt, if you had a moment - I have a few questions around this issue that I would love to be answered!
Kurt_Bremser
Super User

Before you start experimenting, you can run this program in both environments (EG and batch):

data _null_;
path = pathname('WORK');
put path=;
run;

and look at the logs. This will give you a clue about the WORK location(s).

EddieR333
Fluorite | Level 6
When ran in SAS, the output is:
path=/SASWORK/SAS_work3A1900004CAC_ploffice01.tu.local/SAS_work7FD900004CAC_ploffice01.tu.local

When run in batch:
path=/SASWORK/SAS_work1D5F0000538C_ploffice01.tu.local
Kurt_Bremser
Super User

So it's not the location. Then we need to look for other reasons.

Run a proc options in both environments, and look for differences.

(eg you could have the compress system option set in your workspace server)

EddieR333
Fluorite | Level 6

Hi,

 

Thanks for that. I've been comparing the proc options output.

 

I have compared the SAS EG output with PuTTY output and PuTTY Batch output. There are some differences, however BATCH is not working as expected either.

 

I think I need to be using:
/opt/sas/config/Lev1/SASApp/WorkspaceServer/WorkspaceServer.sh

...but, when running this in PuTTY, I am not receiving a log output to compare! Do you have any ideas as to why the log wouldn't be output?

 

Kurt_Bremser
Super User

The WorkspaceServer.sh is the starting script for workspace server, which always needs to send the log to the client and not to a file.

That's why I recommended to use the sasbatch.sh from the BatchServer, which is designed to be used for batch execution.

 

Let us see the logs of the successful and the failed execution of code.

EddieR333
Fluorite | Level 6
I see, thank you.

The entire log is quite lengthy, as I am creating some formats... What would be most helpful in this case?

Here is the log output from the 'opt/..../BatchServer' run from PuTTY:
853 proc contents data=stg.policy out=stg.policy_names(keep=name varnum where=(substr(name,1,5)='Risk_')); run;

NOTE: The data set STG.POLICY_NAMES has 10 observations and 2 variables.
ERROR: An I/O error has occurred on file STG.POLICY_NAMES.DATA.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.25 seconds
cpu time 0.01 seconds

NOTE: The PROCEDURE CONTENTS printed pages 26-27.

854 proc sort data=stg.policy_names; by varnum; run;
ERROR: A lock is not available for STG.POLICY_NAMES.DATA.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds

I am now receiving I/O errors on the POLICY_NAMES file, regardless of being ran via PuTTY or SAS EG. The day gets better..
Kurt_Bremser
Super User

Hmm, you don't have a problem in WORK, you have a problem in library STG, as the write to STG.POLICY_NAMES fails, and the damaged (or possibly locked by another application) file can't be read for the sort.

EddieR333
Fluorite | Level 6

I understand it does look like that.

If I delete the files and re-run in SAS, runs fine.
If I delete the files and re-run in PuTTY, I/O error.

Thanks very much for your help so far Kurt - really appreciate it.

The proc options results are slightly different. As you predicted, compress = NO in Batch. There are a couple of other different ones:

NOXCMD
TERMINAL
SYNTAXCHECK
DEVICE
NOOBJECTSERVER
and some others...

The 2 I am unsure about are TERMINAL & NOOBJECTSERVER.

Kurt_Bremser
Super User

If compress=yes in Enterprise Guide, then that's a strong pointer. Depending on structure and contents, the compress option can reduce physical file size by 90 or more percent.

ChrisNZ
Tourmaline | Level 20

Could it be that you are running under different users, and the batch user does not have write access to STG?

EddieR333
Fluorite | Level 6
ChrisNZ - Hi, thanks for the suggestion - unfortunately, this can't be the problem as the program is creating datasets in the STG directory.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 21 replies
  • 1114 views
  • 4 likes
  • 3 in conversation