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.
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...
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...
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 SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.
Find more tutorials on the SAS Users YouTube channel.