When I imported the .csv file from my desktop via File-> Import Data from SAS EG I can see the data set created as expected. However when I place the same file in server and I used a Data step to import the file I end up with missing records for all the variables. SAS code which I used here is a copy of the log from the File-> Import Data. Only thing which I changed in the coding part is the file location in Infile statement. There is no error in the log file as well.
Appreciate if someone help me to get rid of this issue.
EG converts the input file to a standardized format, copies the result to a file in the WORK location, and then runs a data step to read the converted data. Because of the conversion, this data step code won't fit your original data.
Two possible remedies:
- use proc import on the server, and then copy the data step (created and run by proc import) from the log
- write the data step yourself according to the documentation of the csv file; this option is preferred
Enterprise Guide converts the file to some other format and uses a different delimiter "7F"x between the data values.
Please check your code, the DLM= option on the INFILE statement propably looks like DLM='7F'x. Change it to the correct delimiter, something like DLM=",".
Note that you can also import CSV files that are located on the server
One page 4 of the import wizard you can select "Generalize import step to run outside of Enterprise Guide". Using thsi option will not create an intermediate file and just runs.
Still I facing the same issue after updating the DLM option to DLM=",". Could you please help me understand what is still causing an issue?
Don't expect that a single change will fix your issue on the first try. Use the tool that sits between your ears.
Read the log.
See if the delimiter fits at all (your text file might have a different one).
See if all column specifications match the data in your infile.
If you still end up puzzled, post code&log, and attach a sample of your file.
You probably must change the encoding value. Check the encoding of your original file and change the EG generated code to the one that fits your data e.g utf8..
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: