Output contains missing character and numeric values which needs to converted in to 'No data at this time'.
Attached is a sample output where Name is a character field (length is 😎 and ID is a numeric field.
Any blank values in each columns (Name and ID), then the blank values should be changed to 'No data at this time'.
This should be checked for 10-15 outputs and need to change all blank values to ''No data at this time'.
Character length varies from field to field and all the blank values should be converted to the mentioned text with out truncation.
How this can be done for all the outputs (10 or more). What is the best way to deal with this? any suggestions on this, please
You can add a special date format in proc format that uses an existing date format for non-missing values:
value d_empty
. = "No data at this time"
other = [ddmmyy10.]
;
adding the output here. Thank you!
Assign a proper format:
data have;
infile cards dsd dlm=' ' truncover;
input name $ id;
cards;
KL 1
JL 2
KK
JK
5
;
run;
proc format;
value $c_empty
" " = "No data at this time"
;
value n_empty
. = "No data at this time"
;
run;
data want;
set have;
format name $c_empty. id n_empty.;
run;
Thank you, Kurt Bremser for providing the solution for this. Appreciate your help.
also i just wanted to know if a date field is missing (along with other dates fields are having values with different format), can we use this procedure? then how can we display the same 'No data at this time' for blank date field. Is it doable? Any idea.
Thanks very much for your help and support!!
You can add a special date format in proc format that uses an existing date format for non-missing values:
value d_empty
. = "No data at this time"
other = [ddmmyy10.]
;
@ KurtBremser:- Thank you, Sir for your wonderful help and support. Thanks very much!!
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 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.