BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

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.

5 REPLIES 5
Kurt_Bremser
Super User

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

BrunoMueller
SAS Super FREQ

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.

Babloo
Rhodochrosite | Level 12

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?

Kurt_Bremser
Super User

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.

JesperStrøyer
Calcite | Level 5

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..

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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