When I do a PROC PRINT... why do all of the variables print in Upper-Case? How can I ensure that what's printed, is EXACTLY as the data exists? Tnanks.
@BobWilcox wrote:
When I do a PROC PRINT... why do all of the variables print in Upper-Case? How can I ensure that what's printed, is EXACTLY as the data exists? Tnanks.
Variable names? That's because that's how they were created, SAS doesn't really care about the case of variable names.
If you want control over the names, you can use variable labels instead which have less restrictions than SAS names.
data demo;
MyVar=1;
MYVAR2=2;
MyVAr3=3;
run;
title 'Mixed Case Example';
proc print data=demo label;run;
title;
proc datasets lib=work nodetails nolist;
modify demo;
rename MYVAR2=MyVar2 myvar3=MyVar3;
run;quit;
title 'Camel Case Example';
proc print data=demo ;
run;
title;
PROC PRINT shouldn't change the variable values. Is there a format attached to the variables? I believe there is a format that will upcase all the values, but that would have been the explicit choice of someone, not a default state.
Sorry I am being little cheeky, did you accidentally use UPCASE Format/Informat/ Function by chance to filter chars in your code at some point?
1) Please show the exact code submitted.
2) was the variable that you searched for the text "Last Cycle" the variable printed? (would not have to ask the question if you had shown the Proc print code submitted).
3) Ensure that the set you printed is the one that shows a format of $char175.
What happens if you run the following? Does it work as expected?
Also, check your own data with the ANYLOWER function applied to the variable of interest.
data test;
input Var_Test $Char20.;
cards;
ABCDE
abcde
ABcde
This is my test
hello world
HELLO WORLD
;
run;
title 'Raw data';
proc print data=test;
run;
title 'Upcase formatted';
proc print data=test;
format var_test $upcase.;
run;
title 'Only with lowercase';
proc print data=test;
where anylower(var_test)>0;
run;
If you can't provide a reproducible example or such, you may be better off working with tech support so they can see your confidential data and such.
And verify if you really need NOFMTERR option, if you do, I suspect that could be causing some issues, since it's expecting formats.
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 25. Read more here about why you should contribute and what is in it for you!
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.