BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all!

I want to create a file on the SAS server but I am running PC sas.
ERROR 180-322: Statement is not valid or it is used out of proper order.

298 quit;
endrsubmit;
4 REPLIES 4
SASKiwi
PROC Star
Your program is running only the FILE statement on the server hence the error. An RSUBMIT must be done on a complete SAS step in exactly the same way as you run it on your PC. Try:

rsubmit SAS1;
proc upload data = data.schd out = schd;
run;

data _null_;
set schd end=eof;
file "servername/apps/jobs/test.sas" lrecl=2000;
put var1 var2 var3;
run;

endrsubmit;

This program will upload your PC dataset to the SAS server then run the step writing your data all on the server.
Peter_C
Rhodochrosite | Level 12
"saskiwi"
one could "rsubmit" a step one line at a time and it won't "run" until a "run;" statement is rsubmitted (but it is hard to see when that would help) .

Here it looks like "sasnewbee" wants to write to the file in the server, directly.
Unfortunately there seems no equivalent to "remote library services" for files - unless the filename engines URL or FTP might help .. Of course the server hosting the sas connect server may not support these alternatives.
Additional alternatives to consider are sas integration technologies and sas intrnet both now part of the EBI platform ...
... anyone care to offer examples of these alternatives ?

regards
peterC
SASKiwi
PROC Star
I agree it would be easier to write to the SAS server location directly from the PC. If the server were running Windows this would be dead easy as the file location would become:

\\servername\apps\jobs\test.sas

It looks like the server is running Unix judging by the directory name so unless the server has NFS (Network File System) enabled, I suspect for someone new to SAS a single remote submit uploading the data and writing it is going to be the simplest approach. Message was edited by: SASKiwi
Peter_C
Rhodochrosite | Level 12
FILE statement is valid in a datastep.
Looks like the remote side is not in a datastep

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1142 views
  • 0 likes
  • 3 in conversation