Linux Putty I/O Error when running program - Why?

Reply
Occasional Contributor
Posts: 12

Linux Putty I/O Error when running program - Why?

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.

Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to KurtBremser
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!
Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to KurtBremser
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
Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to KurtBremser

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?

 

Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to KurtBremser
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..
Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

[ Edited ]
Posted in reply to KurtBremser

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.

Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
PROC Star
Posts: 2,370

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

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

Occasional Contributor
Posts: 12

Re: Linux Putty I/O Error when running program - Why?

ChrisNZ - Hi, thanks for the suggestion - unfortunately, this can't be the problem as the program is creating datasets in the STG directory.
Super User
Posts: 10,279

Re: Linux Putty I/O Error when running program - Why?

Posted in reply to EddieR333

Also look at free space in the directory that STG points to, and check if there's a quota set for the user running the code.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 21 replies
  • 176 views
  • 4 likes
  • 3 in conversation