Good evening everyone.
I have a csv files which consists of data and lenght to the colume was given 100. and i wrote another program, that find out if the program encounters more than 100 variables in it. It has to give an error message to the log folder(which is my pc log folder).
But when i execute the below code I see in the log(SAS ENTERPRISE LOG)
NOTE: "No rows were selected".
proc sql noprint;
select distinct DB, DD
into: cod_es separated by ";" , : des_es separated by ";"
from work.Data
WHERE length(DD) = 0 OR length(DD) > 100 ; /*Where length(DD) = 0 and length(DD) > 100*/
quit;
(Also tried with the "and" in where)
Please help me with this. Thank you.
Any suggestions would be appreciated
First thing I suggest is running proc contents on your data set. If the defined length of a variable is 100 or less then you should not expect to find any values with a length greater than 100 as that is the limit on the variable for that data set. No rows selected means none of the variables meet your condition.
I suspect this line has a typo somewhere : "i wrote another program, that find out if the program encounters more than 100 variables in it." I suspect that you meant characters. Without seeing the code and exact error message then I can't really address what may have happened.
Please clarify what you have done.
Your code is testing the length of the variable DD in the dataset WORK.DATA (note: this is potentially confusing name a dataset). If the variable DD is defined with a length of $100 it can never have a value that is larger than 100.
How did you read the CSV file?
If you want to test the length of the strings in the column of the CSV file then you will need to read the data from the CSV into a variable with a length that is longer then $100.
Hello @shailaja3,
In addition to the other comments:
@shailaja3 wrote:
(...)
WHERE length(DD) = 0 OR length(DD) > 100 ; /*Where length(DD) = 0 and length(DD) > 100*/
(...)
(Also tried with the "and" in where)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.