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!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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