BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ACoyle
Calcite | Level 5

Hello,

 

I have a proc export setup that works just fine for all my excel exports, but when I try to convert it to export txt, a portion of it fails.

 

The following is my export for excel, note the port and server listing. This works as desired.

 

proc export data=SQL_TABLE
outfile="&v_Path&v_Fname"
dbms=excelcs label replace;
port=9621;
SERVER='pv2medsaspc1';
sheet="Sheet1";
run;

 

But when I try running it set for a text file:

 

proc export data=SQL_TABLE
outfile="&v_Path&v_Fname"
dbms=tab REPLACE;
putnames=no;
port=9621;
SERVER='pv2medsaspc1';
run;

 

I get the below error:

 

25 GOPTIONS ACCESSIBLE;
26 proc export data=SQL_TABLE
27 outfile="&v_Path&v_Fname"
28 dbms=tab REPLACE;
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
29 putnames=no;
30 port=9621;
____
180
31 SERVER='pv2medsaspc1';
______
180
ERROR 180-322: Statement is not valid or it is used out of proper order.

32 run;

 

I cannot remove the port and server entries, as then I just get an insufficient authorization error. I have included the log for this.

 

Please, any suggestions.

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Use a proper path on the server. The scheduled job will need an additional step that copies the result to the desired location in your network.

Or you have a network share mounted on your UNIX server where you can write the result directly from SAS.

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

excelcs is designed to work with the PC Files Server, whil dbms=tab always works locally and does not have server or port parameters, so these statements are invalid.

Kurt_Bremser
Super User

And you need to provide a valid path for the text file, in a directory where you have write permission on the UNIX server.

 

I suggest you use the export task of Enterprise Guide, as that handles the downloading of the exported text data on its own.

ACoyle
Calcite | Level 5

Unfortunately this process is designed to be scheduled using Crontab, and not able to utilize the enterprise guide services. Is there a recommendation on how to get around this limitation?

Kurt_Bremser
Super User

Use a proper path on the server. The scheduled job will need an additional step that copies the result to the desired location in your network.

Or you have a network share mounted on your UNIX server where you can write the result directly from SAS.

ACoyle
Calcite | Level 5

Well that's a bit of a bummer for our purposes, we'll have to change our SOPs to accommodate this.

 

Thank you for the quick replies and helping!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 1073 views
  • 0 likes
  • 2 in conversation