SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ljim1075
Obsidian | Level 7

I have a field_name that it's format is $1, meaning 1 character value.  I'm trying to pull the values that are in lowercase ONLY.  Can you assist?

query:

proc print data=tera.Table_A (obs=10);
where field_name in ('b');
run;

 

When I run the above query it returns all uppercase 'B' and lowercase 'b'

1 ACCEPTED SOLUTION

Accepted Solutions
ljim1075
Obsidian | Level 7

Reeza,

 

Based on the info that you've provided, I've found this doc: https://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/access_teradata_9298.pdf which clarifies some of the case sensitive issues with Teradata.  To solve for 90% of my issue I've added DBSLICEPARM = All into my Libname statement and it worked!  Now I say 90% solved, because when I run a PROC FREQ statement it still does not count the lowercase values.

 

Overall, thank you for the info!

View solution in original post

4 REPLIES 4
Reeza
Super User

@ljim1075 wrote:

I have a field_name that it's format is $1, meaning 1 character value.  I'm trying to pull the values that are in lowercase ONLY.  Can you assist?

query:

proc print data=tera.Table_A (obs=10);
where field_name in ('b');
run;

 

When I run the above query it returns all uppercase 'B' and lowercase 'b'


Are you sure that's what's happening?

Can you post the output and log?

That shouldn't happen AFAIK.

 

Also, is tera.table_A a SAS dataset or is it a data set from a server? If server, what type?

 

EDIT: Cannot replicate your issue, does the example below run as expected

data have;
input field_name $1.;
cards;
b
B
a
c
C
d
d
D
b
b
B
f
;
run;

proc print data=have(obs=10);
where field_name in ('b');
run;
ljim1075
Obsidian | Level 7

Reeza,

 

Thank you for your response!  I've ran your query and it worked perfectly, but when i run it on my end on my server Teradata table, see results below:

ljim1075_0-1634926905304.png

When I look for the particular primary key the I know it has lower case, see response below:

ljim1075_1-1634927090203.png

Also when I submit a proc freq query, see response below:

ljim1075_2-1634927209396.png

It almost assumes that 'J' and 'j' are the same

There are no errors in the log.  Let me know what you think...

TY!

 

Reeza
Super User
Teradata can have columns that are casespecific or noncasespecific. Can you check the attributes on that column in Teradata?
I suspect that's the issue.

https://docs.teradata.com/r/1DcoER_KpnGTfgPinRAFUw/G2qHRG2iKwM5d1Ui61MgCA
ljim1075
Obsidian | Level 7

Reeza,

 

Based on the info that you've provided, I've found this doc: https://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/access_teradata_9298.pdf which clarifies some of the case sensitive issues with Teradata.  To solve for 90% of my issue I've added DBSLICEPARM = All into my Libname statement and it worked!  Now I say 90% solved, because when I run a PROC FREQ statement it still does not count the lowercase values.

 

Overall, thank you for the info!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1296 views
  • 2 likes
  • 2 in conversation