BookmarkSubscribeRSS Feed
ucvikas
Obsidian | Level 7

Dear All

I have xls file and one of column has value like this 'some text1','some text2','some text3' (with quotes)  ,While reading this xls file using proc import SAS  misses first " ' " from the value in dataset .and I get value in dataset as

some text1','some text2','some text3' (note 1st quote is missing)

Can anyone let me know reason or fix for this ?

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please supply the code you are using and an example file as it appears you are talking about two different things.  What I mean by this is that an Excel XLS file would not be stored as you state above (unless of course the quotes are in the cells themselves), so I am assuming that you are talking about a CSV (comma separated variable) file, which Excel can open, but is not a native Excel file format.

So what is your code for importing this, do you want all the text in one variable?  Maybe try:

data want;

     infile "You_data.csv" dsd missover dlm='¬';

     input buffer $varying256.;

run;

ucvikas
Obsidian | Level 7

I use code something like this

proc import datafile = "location_of_file/test_file.xls"

            out      =  test_file replace dbms=xls;

            sheet    = "sheet1";

  getnames = yes;

run;

attached is test file (see original post) and you will notice that first single quote is missed once file is read with the code I supplied;

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!

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.

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