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-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
  • 4 replies
  • 852 views
  • 0 likes
  • 3 in conversation