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

Hi all,

I saw many program that have format ??format.  Used in input, put, ....   I can not find any reference of why they use '??'.  Could anyone explain me a little bit or give me some references to read.

Thank you very much,

Abdu

1 ACCEPTED SOLUTION

Accepted Solutions
stat_sas
Ammonite | Level 13

*(??) modifiers that suppress the printing of both the error messages and the input lines when invalid data values are read.

data have;
input EmployeeID $;
datalines;
12
12
ab
9
13
;
/* With error message */

data want;
set have;
eid=input(EmployeeID, 2.);
run;

/* Without error message */

data want;
set have;
eid=input(EmployeeID, ??best.);
run;

View solution in original post

6 REPLIES 6
stat_sas
Ammonite | Level 13

*(??) modifiers that suppress the printing of both the error messages and the input lines when invalid data values are read.

data have;
input EmployeeID $;
datalines;
12
12
ab
9
13
;
/* With error message */

data want;
set have;
eid=input(EmployeeID, 2.);
run;

/* Without error message */

data want;
set have;
eid=input(EmployeeID, ??best.);
run;

Abdu
Calcite | Level 5

But in this way, we will lost some data issue information.  That is really not a good way to use this modifier.  Any good reason to use this modifier?

Haikuo
Onyx | Level 15

if the format does not match the data elements you are reading, you are losing them anyway, unless you change the format to some universal char. ?? is merely to suppress the error message in the log.

Haikuo

Abdu
Calcite | Level 5

But in Clinical field, we need to catch these information.  This might be a typo, or program flaw, we absolutely need to fix that, not just suppress the error message.  You are right, maybe in the other field, that information is not important.

Haikuo
Onyx | Level 15

We are deviating the discussion from the original path that you set. You were asking what "??" do, and I think you have your answer. If you now are trying to ask how to read in certain data intact, then you probably want to show us some sample data, and for the better, to initiate a brand new discussion.  But in general like I mentioned you would need the informats for character instead of number (such as the one you put up for example "best.").

Regards,

Haikuo

BrunoMueller
SAS Super FREQ

Check the doc for the INPUT statement, search for "How Invalid Data Is Handled" it will explain about the ? and ??

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 1281 views
  • 0 likes
  • 4 in conversation