06-27-2016 06:00 PM
I have an variable called "SUPPORT_CUST_NAME". It is defined as "Char" type with leng of 100. it is labled as "SupportCustName".
Dataset name is "ELT.ELT_SEC_SUPPORT_BY".
The problem is that the value of "SUPPORT_CUST_NAME" seems chopped much less than 100. Many names are chopped. I need to find the longest value to confirm my finding?
How do I find out the longest length of value for "SUPPORT_CUST_NAME" with its primay key "CR_APPL_NO"?
Please help with SAS code!
06-27-2016 06:44 PM
Before you examine the lengths, the first step would be to examine the format. If a variable is defined as $100 but has a format of $50., you will only see the first 50 characters.
06-27-2016 07:16 PM
How to write the code to find out?
Here is my code to look at the table:
data elendSUPPORTBY; set ELTElend.ELT_SEC_SUPPORT_BY; Title "Support by in ELT ELEND"; proc print data= elendSUPPORTBY; run;
06-27-2016 11:45 PM
Thank you so much for the SAS SQL query! The SAS query works very well.
Does the embedded sql query follow standard SQL syntax? Do they follow Oracle or DB2 or Microsoft standard?
06-28-2016 01:09 AM
SAS SQL doesn't necessarily follow ANSI SQL standards. Most basic queries such as the one here, can be used in both Oracle and SQL.
SAS FEDSQL is ANSI standard.
Oracle SQL is different than Microsoft SQL.
You can use SQL pass through if you want to pass a query directly to your server.
06-28-2016 12:04 AM
Thank you for your suggestion. Yes. I have tried proc contents, that is how I get to know this variable SUPPORT_CUST_NAME is char type with length of 100. But somehow only display 40 chars.
It may due to an error in ETL process.
Thank you so mcuh for help!
Need further help from the community? Please ask a new question.