Desktop productivity for business analysts and programmers

Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Reply
Frequent Contributor
Posts: 148

Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Hello Friends,

 

Am trying to import excel file from 9.4 SAS Grid control node to PC File server,I tried various to import the file but the none of the code is working.Its giving so many issues.

 

I tried  below code to import, I would really appreciate if anyone can assist me in regards to this

please send me  the correct code for exporting file from PC file server to Grid control node also.

 

I tried all the codes given in the support websites also but none of them worked,not sure where its going wrong

 

 

 

PROC IMPORT DBMS=EXCELCS 

            DATA= 'D:\pcfile\Demo.xls’

            OUTFILE= \tmp REPLACE;

            PORT=xxxx;

            SERVER='xxxxxxxxxx';

            SHEET='yoursheet';

RUN;

 

 

Thank you

 

Esteemed Advisor
Posts: 6,698

Re: Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Without the log, there is nothing we can do to help you.

"It does not work" provides NO clue at all about your problem(s)!

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 148

Re: Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Thank you so much for your prompt reply When I used below code for import from grid node to pc file server by launching sas on node,am getting below error proc import dbms=excelcs data='D:\pcfile\Demo.xls' outfile=\tmp REPLACE; port=xxxx; server="xxxxxxxxxxx"; sheet=sheet1; run; Proc import dbms=excelcs data='D:\pcfile\Demo.xls' ---- 22 76 Error 22-322 Syntax error,expecting onc eof the following: ;,DATAFILE,DATATABLE,DBMS,DEBUG,FILE Error 76-322 Syntax error,statement will be ignored outfile=\tmp REPLACE; port=xxxx; server="xxxxxxx"; run; when am using below export code am getting below error proc export data= sashelp.prdsale; dbms=xls; file="D:\pcfile\prdsale.xls"; port=xxxx; server="xxxxxxxxxxx"; sheet=sheet1; run; proc export data=sashelp.prdsale; Error:FILE or TABLE is required and must be specified. dbms=xls; file="D:\pcfile\prdsale.xls"; port=xxxx; server="xxxxxx"; sheet=sheet1; run; am not sure where its going wrong,would appreciate if you can suggest
Respected Advisor
Posts: 3,065

Re: Issues with SAS Import/Export from Linux to PC File server and PC to Linux

To correct the first syntax error use OUT = DatasetName not OUTFILE. = . To fix the second syntax error add OUT = . 

Occasional Contributor
Posts: 17

Re: Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Hello,

I've had similar issues where we tried to SAS Import from PC to Linux. I found that the PC File Server is not very reliable.

 

As a workaround, First importing the file into Linux, and then importing is more reliable. I first upload the file into Linux, and then run an import code to bring into SAS:

 

proc import datafile="/LINUX_FILE_PATH_HERE/CREPI.csv"
out=temp.CREPI dbms=CSV replace; run;

Frequent Contributor
Posts: 148

Re: Issues with SAS Import/Export from Linux to PC File server and PC to Linux

Thank you Terho, I want to import file from PC file server to Grid node In the code provided you have not mentioned the pc file server port and server name. and also does import works in this case for csv file..I believe it works only with excel and access files.
Ask a Question
Discussion stats
  • 5 replies
  • 389 views
  • 1 like
  • 4 in conversation