BookmarkSubscribeRSS Feed
Shaunkingston
Calcite | Level 5

Hello everyone,,

I need 2 things from SASMA (user defined node for CI linked to stored process).

1) Handle and raise errors with user messaging regarding SAS and Oracle errors. I read documentation but will be thankfull for good approach (native and stable way to raise error with messaging)

2) Popup interactive example to show custom popup in CI (2 types yes/no and OK buttons) and read user action in sas code (stored process)

Regards..

1 REPLY 1
JamesAnderson
SAS Employee

Hello,

There is no way to provide interactive pop-up dialogues. The closest for that is to use prompts inside the stored process/custom node.

 

For error messages below are some examples of the method I use. I haven't used it in the examples below, but if you want to include a custom error number you can also declare and set a macro variable for MAError (e.g. %let MAError=10001;) which will then get displayed in the error dialogue shown to the user.

 

Regards

James

 

Example 1: This error was for a custom node that was only intended to have a single upstream input, so we check how many inputs are present and conditionally raise an error.

  %if %SYMEXIST(INTABLE0) %then %do ;
    %if %NRQUOTE(&INTABLE0) ne %NRQUOTE(1) %then %do ;
      %** Multiple input nodes - invalid! ;
      %let MAMsg=Error. The Deduplication node must have 1 input. ;
%let SYSCC=12 ; %mastatus(&_stpwork.status.txt) ; %return ; %end ; %end ;

Example 2:  This code is used to handle a situation where a sas dataset with reference data was not found, and the custom node cannot proceed.

 

	%** open the dataset to check the number of records **;
	%let dsid = %sysfunc(open(WORK.CTRL));

        %** If the data set exists, get the number of observations and then close the data set **;
	%if &dsid %then
   		%do;
      	        	%let nobs =%sysfunc(attrn(&dsid,nobs));
      		        %let rc = %sysfunc(close(&dsid));
   		%end;
	%else %do;
	        %** if the dataset doesnt exist then exit, we cant continue without it **;
		%put 'WARN: The Employee CTRL file was not created. Exiting';

		%let MAMsg=ERROR: The Employee CTRL file was not created. Exiting. ;
        	%let SYSCC=12 ;
         	%mastatus(&_stpwork.status.txt) ;
        	%return ;
	%end;

 

How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 760 views
  • 1 like
  • 2 in conversation