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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 897 views
  • 0 likes
  • 4 in conversation