BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
eddieleung305
Obsidian | Level 7

We are doing SAS9 migration from M5 to M8. We noticed that in running the same program code with the INPUT function. The data feeding input line from file to variables contains an error, the error contents will not output to the program log in M5 but it will on the M8 system. We need to put '??' to suppress the error message printing to prevent dumping user data to the program log directly.

 

proc sql noprint;
5583 select
5584 cat('(' ,start, '<=' ,'input(&&OLDVAR&i.,?? anydtdtm.)', '< ',end,')') into : BST_Date_Check separated by ' or '
5585 from fmt
5586 where start ne .
5587 ;

 

From SAS document (Ref: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p19en16vskd2vhn1vwmxpxnglxxs.h...

INPUT(source<? | ??> informat.)

? or ??

specifies the optional question mark (?) and double question mark (??) modifiers that suppress the printing of notes and input lines when invalid data values are read. The ? modifier suppresses the invalid data message. The ?? modifier suppresses the invalid data message and prevents the automatic variable _ERROR_ from being set to 1 when invalid data is read.

 

Question:

1. Are there any SAS Options that can help suppress the printing behaviour? We are suspecting there are options preset on the M5 system but I have compared the full options list but have not identified any major differences.

2. Is it a behaviour change in M8

 

Thank you for your sharing.

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

I would regard this behaviour as a bug fix. M5 should have put an invalid data message in the log but didn't while M8 correctly puts it in. I've encountered similar issues with SAS upgrades and I'd rather error-trapping behaviour is corrected rather than leaving the bug so as to be compatible with M5.

 

We are about to start an M8 upgrade ourselves and I am in no doubt that we will find this and other "code-tightening" issues...

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

I would regard this behaviour as a bug fix. M5 should have put an invalid data message in the log but didn't while M8 correctly puts it in. I've encountered similar issues with SAS upgrades and I'd rather error-trapping behaviour is corrected rather than leaving the bug so as to be compatible with M5.

 

We are about to start an M8 upgrade ourselves and I am in no doubt that we will find this and other "code-tightening" issues...

Quentin
Super User

Agree, this seems like a bug fix.  Perhaps related to: https://support.sas.com/kb/68/071.html .  When INPUT reads data and the informat can't handle the value, it's supposed to throw an error (unless you have suppressed the error with ??).  This error-less log is shocking to me (9.4M7):

1    data try ;
2     x=input('foo',anydtdtm.) ;
3     put x= ;
4    run ;

x=.
NOTE: The data set WORK.TRY has 1 observations and 1 variables.

So if you're saying that throws an error in M8, I'd say that's a fix to some bizarre thing anydtdtm was doing to 'eat' the invalid data and return a missing value.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 612 views
  • 2 likes
  • 3 in conversation