BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Criptic
Lapis Lazuli | Level 10

Hello,

 

I have a STP which runs under the sassrv technical user. With the follwing x-command I create a list of all work-directories with a certain table inside of them and then want to import it as a table. When I run the code as another user it works fine, but with the sassrv user nothing gets imported.

 

Coding:

x "find &workpath. -name &tableName..sas7bdat > &workpath./work_directories.txt";

proc Import datafile="&workpath./work_directories.txt"
                out=work.work_finding_1
                dbms=dlm
                replace;
                getnames=NO;
        run;

Result when I run the coding with my user:

NOTE: The infile '/work_p/work_directories.txt' is:
      Filename=/work_p/work_directories.txt,
      Owner Name=XXXXXXX,Group Name=XXXXXX,
      Access Permission=-rw-r--r--,
      Last Modified=16Sep2019:10:38:22,
      File Size (bytes)=81

NOTE: 1 record was read from the infile '/work_p/work_directories.txt'.
      The minimum record length was 80.
      The maximum record length was 80.
NOTE: The data set WORK.work_finding_1 has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

Result when sassrv runs the same code:

NOTE: The infile '/work_p/work_directories.txt' is:
      Filename=/work_p/work_directories.txt,
      Owner Name=sassrv,Group Name=sas,
      Access Permission=-rw-r--r--,
      Last Modified=16. September 2019 10.38 Uhr,
      File Size (bytes)=81

NOTE: 0 records were read from the infile '/work_p/work_directories.txt'.
NOTE: The data set WORK.WORK_finding_1 has 0 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

Content of the txt File:

/work_p/SAS_work1D9C015D00B6_macdb001/SAS_work0994015D00B6_macdb001/aa1.sas7bdat

 

I am completly lost as to why this is happening.

 

Any help would be greatly welcomed


Kind Regards

Criptic

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

Looks strange to me, as the permissions for the file is the same in both cases, and the file size as well.

 

Could it be that the system option OBS has been set to 0 somewhere earlier in the program, when it runs on the server? SAS sets the system option SYNTAXCHECK in batch mode, meaning that if an error is encountered, it sets OBS to 0 and continues. You may want to look for errors earlier in the log from the batch session. An alternative is to set the ERRORABEND option in the batch program, so that it stops when an error is encountered, or (the dirty way) to set the option NOSYNTAXCHECK, so that SAS continues with OBS=MAX (or whatever you have explicitly set it to earlier).

 

 

 

 

View solution in original post

3 REPLIES 3
s_lassen
Meteorite | Level 14

Looks strange to me, as the permissions for the file is the same in both cases, and the file size as well.

 

Could it be that the system option OBS has been set to 0 somewhere earlier in the program, when it runs on the server? SAS sets the system option SYNTAXCHECK in batch mode, meaning that if an error is encountered, it sets OBS to 0 and continues. You may want to look for errors earlier in the log from the batch session. An alternative is to set the ERRORABEND option in the batch program, so that it stops when an error is encountered, or (the dirty way) to set the option NOSYNTAXCHECK, so that SAS continues with OBS=MAX (or whatever you have explicitly set it to earlier).

 

 

 

 

Criptic
Lapis Lazuli | Level 10

@s_lassen thank you every much this seems to be the problem for me, as I tested it with

data work.test;
     set sashelp.class;
run; 

* Log-Entry;
NOTE: There were 0 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.TEST has 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds

The Log I can view of the STP in EG doesn't contain any warnings or errors so the error must occur somewhere in the autoexec-flow of the STP. Is there a way to view that log?

Criptic
Lapis Lazuli | Level 10
I found a quick way by running the different autoexec-files that get included by the STP-Server in batch and found my error.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 737 views
  • 2 likes
  • 2 in conversation