PROC Compare and checking &SYSINFO

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

PROC Compare and checking &SYSINFO

I'm trying to query the return code of a PROC COMPARE, and not getting the results I expect.

 

My compare has differences, which I expect, and the SASLIST indicates as much with this message –

 

                Number of Observations with Some Compared Variables Unequal: 5.

 

However when I check the value of &SYSINFO its 0. The only way I can get the code below to work is by changing the 1 to a 0, which doesn't identify a difference for me -

 

 

PROC COMPARE base=expected compare=file1s;
                                                  
data _null_;                              
  if &sysinfo >= '1'  then                
      put 'fred fred fred';               
run;                                      

 

Any idea what I'm missing?


Accepted Solutions
Solution
‎08-25-2016 12:47 PM
Grand Advisor
Posts: 10,223

Re: PROC Compare and checking &SYSINFO

Sysinfo would only contain a value other than 0 if something went wrong with the actual compare function such as missing one of the required elements or incorrect syntax. If the compare runs then you need to examine the results.

 

You may be looking for one of the options with Proc compare to create an output data Out= with something like the OUTDIF option.

View solution in original post


All Replies
Solution
‎08-25-2016 12:47 PM
Grand Advisor
Posts: 10,223

Re: PROC Compare and checking &SYSINFO

Sysinfo would only contain a value other than 0 if something went wrong with the actual compare function such as missing one of the required elements or incorrect syntax. If the compare runs then you need to examine the results.

 

You may be looking for one of the options with Proc compare to create an output data Out= with something like the OUTDIF option.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 204 views
  • 0 likes
  • 2 in conversation