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

Hello,

 

This is not a question .... it's just an FYI, which might save somebody a few minutes (or hours!)  

 

I am working on MVS, and migrating a Production Job from SAS9.1 to SAS9.4. A mysterious error message appeared.

 

ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be converted to a numeric value.

 

Under SAS9.1 the error message does not occur, and the Job finishes with RC=00.

Under SAS9.4 the error message occurs, and the Job abends with RC=08. 

 

Here is the relevant part of the Program. The error message is being created (under SAS9.4) by the final line in this snippet.

%put >>> ------------------------------------------------------- ;
%put >>> Transfer number &J , for table &&stab&j is complete ;
%put >>> ------------------------------------------------------- ;

%let SYSCC=%sysfunc(COMPRESS( &SYSCC.,0123456789,k));
%let MYSYSCC=%sysfunc(COMPRESS(&MYSYSCC.,0123456789,k));

%put >>> "SYSCC" : "&SYSCC.";
%put >>> "MYSYSCC": "&MYSYSCC.";

%let SYSCC = %sysfunc(max(&SYSCC., &MYSYSCC.));

 

SAS9.4 Log:

>>> -------------------------------------------------------
>>> Transfer number 1 , for table KEABTT is complete
>>> -------------------------------------------------------

>>> "SYSCC" : "0"
>>> "MYSYSCC": "0"
ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be converted to a numeric value.
ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be converted to a numeric value.
ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be converted to a numeric value.

 

(I introduced the COMPRESS and "QUOTES", to try to identify any extra/invalid characters which might be finding their way into the Macro Vars, but the code did not find any).

 

After some investigation and much trial-and-error, we fixed the problem by changing the line like this:

%let SYSCC=%sysfunc(max(&SYSCC.,&MYSYSCC.));

 

 

It seems like SAS9.4 is much stricter with the values that can be passed into SYSCC, and does not tolerate any leading blank spaces.

 

I could not find any documentation for this error message (in documentation for Base or Macro). If you know that there is some, and I simply could not find it, please could you Post the location? 

 

Regards,

Antony

1 ACCEPTED SOLUTION

Accepted Solutions
aknight1
Obsidian | Level 7

Hi ...

 

Just for info. Now I get to my answer. If I look at my program code with 'hex on' then I see the following, for the guilty line:

   %let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
444698A4EEECC44746AAA8A98498A45EEECC4645DEEEECC45554444
000C35302823300E1C2826453D417D028233BB004828233BDDE0000

 

This hex'41' is apparently the non-breaking space.

https://en.wikipedia.org/wiki/Non-breaking_space 

 

If this character gets fed into SYSCC in SAS9.1 then there is no problem.

If this character gets fed into SYSCC in SAS9.4 then it causes an error.

If this character gets fed into %EVAL in SAS9.1 or SAS9.4 then it causes an error.

 

This nerd is now happy Smiley Very Happy

 

Regards,

Antony

View solution in original post

8 REPLIES 8
Reeza
Super User
Did you already put in a ticket to the service desk?
aknight1
Obsidian | Level 7

Hi Reeza ...

 

Honestly, I was expecting (still am expecting) somebody to admonish me ...

 

http://documentation.sas.com/relevant-documentation-is-here-you-fool.html

 

If this is not forthcoming then yes I will report the problem.

 

Thanks & Regards,

Antony

Patrick
Opal | Level 21

@aknight1 

May be macro quoting creates the issue. Below run with SAS9.4M5 under RHEL.

28         %let syscc=4;
29         %let syscc=%nrbquote(&syscc);
ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be 
       converted to a numeric value.
30         %put &=syscc;
SYSCC=1012
31         
32         %let syscc=4;
33         %let syscc=%eval(%nrbquote(&syscc));
34         %put &=syscc;
SYSCC=4

  

aknight1
Obsidian | Level 7

Hi @Patrick ...

 

Thanks for this suggestion. I scanned the program for any cases of quoting, and could not find.

 

But your suggestion prompted some further testing ... I think now I get closer to finding the underlying cause ...

%let   SYSCC  =  0;
%let MYSYSCC  =  0;
%let SYSCC    =  &SYSCC.;
%put >>> Step1: SYSCC: &SYSCC.;

%let   SYSCC  =  0;
%let MYSYSCC  =  0;
%let SYSCC    =  &MYSYSCC.;
%put >>> Step2: SYSCC: &SYSCC.;

%let   SYSCC  =  0;
%let MYSYSCC  =  0;
* I have typed the below line directly;
%let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
%put >>> Step3: SYSCC: &SYSCC.;

%let   SYSCC  =  0;
%let MYSYSCC  =  0;
* I have copy-and-pasted the below line from the original program;
%let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
%put >>> Step4: SYSCC: &SYSCC.;

SAS9.4Log:

72
73    %let   SYSCC  =  0;
74    %let MYSYSCC  =  0;
75    %let SYSCC    =  &SYSCC.;
76    %put >>> Step1: SYSCC: &SYSCC.;
>>> Step1: SYSCC: 0
77
78    %let   SYSCC  =  0;
79    %let MYSYSCC  =  0;
80    %let SYSCC    =  &MYSYSCC.;
81    %put >>> Step2: SYSCC: &SYSCC.;
>>> Step2: SYSCC: 0
82
83    %let   SYSCC  =  0;
84    %let MYSYSCC  =  0;
85    * I have typed the below line directly;
86    %let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
87    %put >>> Step3: SYSCC: &SYSCC.;
>>> Step3: SYSCC: 0
88
89    %let   SYSCC  =  0;
90    %let MYSYSCC  =  0;
91    * I have copy-and-pasted the below line from the original program;
92    %let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
ERROR: The value supplied for assignment to the numeric automatic macro
       variable SYSCC was out of range or could not be converted to a
       numeric value.
93    %put >>> Step4: SYSCC: &SYSCC.;
>>> Step4: SYSCC: 1012

It seems like there is a hidden character in my actual line of %sysfunc(max( )) code, which is getting passed into the SYSCC macro variable. This did not cause a problem in SAS9.1, but SAS9.4 does not like it.

 

Regards,

Antony

aknight1
Obsidian | Level 7

Hi ...

 

Just for info. Now I get to my answer. If I look at my program code with 'hex on' then I see the following, for the guilty line:

   %let SYSCC  = %sysfunc(max(&SYSCC., &MYSYSCC.));
444698A4EEECC44746AAA8A98498A45EEECC4645DEEEECC45554444
000C35302823300E1C2826453D417D028233BB004828233BDDE0000

 

This hex'41' is apparently the non-breaking space.

https://en.wikipedia.org/wiki/Non-breaking_space 

 

If this character gets fed into SYSCC in SAS9.1 then there is no problem.

If this character gets fed into SYSCC in SAS9.4 then it causes an error.

If this character gets fed into %EVAL in SAS9.1 or SAS9.4 then it causes an error.

 

This nerd is now happy Smiley Very Happy

 

Regards,

Antony

aknight1
Obsidian | Level 7

Hi @Patrick ....

 

Thanks for the link! .... this was the documentation I could not find Smiley Happy

 

Regards,

Antony

Patrick
Opal | Level 21

@aknight1 

I found it simply by copy/pasting the error message into a Google search.

I didn't know that it exists so learned something 🙂 

 

Have you tried using %EVAL() instead of %sysfunc(compress()). Does that work for your case?

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 8 replies
  • 1752 views
  • 0 likes
  • 3 in conversation