BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jinu302000
Fluorite | Level 6

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

 

1 ACCEPTED SOLUTION
6 REPLIES 6
PeterClemmensen
Tourmaline | Level 20
When you sat ‘for all the outputs’, do you meab that you want to do this for all obsetvations or?
Kurt_Bremser
Super User

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;
Jinu302000
Fluorite | Level 6

Thank you, Kurt Bremser 

 

 

Jinu302000
Fluorite | Level 6

@ KurtBremser:- Thank you, Sir for your wonderful help and support. Thanks very much!!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1742 views
  • 1 like
  • 3 in conversation