PROC IMPORT DOES NOT WORK

Reply
Contributor
Posts: 35

PROC IMPORT DOES NOT WORK

Hi All.

Could someone explain what is the alternative if PROC IMPORT does not work.

Super Contributor
Posts: 282

Re: PROC IMPORT DOES NOT WORK

Hi,

Would a data step help? It is a bit difficult to suggest without some context.

What code have you tried and what errors / issues are you getting?

What is your input and output like?

Regards,

Amir.

New Contributor
Posts: 3

Re: PROC IMPORT DOES NOT WORK

You could possibly use "PUT" to create a flat file with the SAS data you intended to export/import and then ftp or otherwise transfer the flat file and input it in a data step.


Contributor
Posts: 35

Re: PROC IMPORT DOES NOT WORK

Hi AlanGray,

Could u please explain with an example or syntax of put file .

Super User
Posts: 5,432

Re: PROC IMPORT DOES NOT WORK

PUT can be used instead of PROC EXPORT, not IMPORT.

Again, explain your problems with IMPORT, and what kind of file you are trying to import.

Data never sleeps
New Contributor
Posts: 3

Re: PROC IMPORT DOES NOT WORK

I agree my repley to the initial question did not explain that the PUT was to replace the proc export portion of the planned data exchange. This is assuming that the file you want to import is a SAS file and that you have access to the platform the file is coming from. In a data step you would simply use PUT to externalize the fields needed to a flat file. The FILE stmt would specify what file the data would be written to. The systax of that varies by platfrom. A crude example that will put heading fields out for the first obs and use commas for the following is being pasted below.

DATA TEMP;

SET TEMP;

FILE CSVOUT;    /* CSV FILE */

IF _N_=1 THEN PUT 'SYSID,JOB,DAY,HOUR,CPUTM';

PUT SYSID "," JOB "," DAY "," HOUR "," PGMCPUTM;

This file could then be moved to the other platform via ftp or remotely access via the SAS FTP method on the platform you want to import the data to. I'm sure there are fancier ways to do this as well.

I also agree with the other poster's that an example of what errors you are encountering or what you are specifically trying to do would be key to getting a resolution.

New Contributor
Posts: 3

Re: PROC IMPORT DOES NOT WORK

Did you see the example I posted? Is this still an issue?

Frequent Contributor
Frequent Contributor
Posts: 83

Re: PROC IMPORT DOES NOT WORK

Sometimes it depends on the licence. If Excel SAS talking is restricted then Proc import could be a problem.

My system does not allow me to export to Excel but I can export to csv. It doesn't allow me to do proc import an excel file.

However from the file menu you can import by following the prompt.

Ask a Question
Discussion stats
  • 7 replies
  • 412 views
  • 0 likes
  • 5 in conversation