lowercase data is combined with uppercase data when using proc export

Accepted Solution Solved
Reply
New Contributor JJS
New Contributor
Posts: 2
Accepted Solution

lowercase data is combined with uppercase data when using proc export

I have this dataset with a variables TESTNAME and RESULTS.

One of my TESTNAME values is x(D65) and another is X(D65), (lowercase and uppercase) which represent different types of tests.

When I export this dataset using PROC EXPORT to Excel, CSV, TXT, the lower- and uppercase values are all converted to uppercase X(D65).

Other TESTNAMES which only have a lowercase value (e.g. v(D65)) remain lowercase.

Is there a way to keep the separate values x(D65) and X(D65) in the exported dataset?


Accepted Solutions
Solution
‎05-16-2013 07:44 AM
Super User
Posts: 5,431

Re: lowercase data is combined with uppercase data when using proc export

Can't reproduce, my files are comming out in both cases.

Are you sure that the data isn't upcased before the export, or in the file viewer?

data a;
input x $;
datalines;
x(D65)
X(D65)
run;

proc export data=a outfile="text.csv" dbms=csv;
run;

Test.csv:

x

x(D65)

X(D65)

Data never sleeps

View solution in original post


All Replies
Solution
‎05-16-2013 07:44 AM
Super User
Posts: 5,431

Re: lowercase data is combined with uppercase data when using proc export

Can't reproduce, my files are comming out in both cases.

Are you sure that the data isn't upcased before the export, or in the file viewer?

data a;
input x $;
datalines;
x(D65)
X(D65)
run;

proc export data=a outfile="text.csv" dbms=csv;
run;

Test.csv:

x

x(D65)

X(D65)

Data never sleeps
New Contributor JJS
New Contributor
Posts: 2

Re: lowercase data is combined with uppercase data when using proc export

You're right. The problem was with the file viewer not with the PROC EXPORT.

Super Contributor
Posts: 282

Re: lowercase data is combined with uppercase data when using proc export

Hi,

I tried the following code, and all of my values kept the correct case in the spread sheet:

data have;

  input text $char6.;

  datalines;

v(D65)

V(D65)

x(D65)

X(D65)

;

proc export data= work.have

            outfile= "c:\temp\want.xls"

            dbms=excel replace;

     sheet="want";

run;

Please share your data and code.

Regards,

Amir.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 266 views
  • 0 likes
  • 3 in conversation