Desktop productivity for business analysts and programmers

How to send mail to the user or show any popup window if my output size is bigger than the location?

Reply
Contributor
Posts: 71

How to send mail to the user or show any popup window if my output size is bigger than the location?

I am working with SAS EG and DI Studio. I have one report where out put is in Excel format and to run the code I am using DI Studio for prompt creation. Now the situation is like, due to the short storage I am not able to create the output, it is showing some error in the log. The way out is like if select some less selection then the error is not coming. Is there any way where If I will get that error, parallel way I will get some mail stating like due to my selection this is happening, I have to select some less selection. Because if I am user I can not see the log. As an user I can see only the portal page created by DI Studio.

REF: The error is "SAS System stopped processing this step because of insufficient memory."

I hope I am able to make you understand.

Would you please suggest me one way to fix the issue.

NOTE: I can not change the output location or the size of the location.

 

Regards

Sourav

Super User
Posts: 9,611

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to Sourav_sas

This

"SAS System stopped processing this step because of insufficient memory"

doesn't look like you are running out of disk space, this looks like not enough main memory available to the process.

How do you create your Excel output?

 

Basically, I would structure my prompt(s) in such a way that invalid selections are rejected at input. Or it's possible to solve the issue by using more efficient code.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 71

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to KurtBremser

Hi

Thanks for your feedback. My issue is related to main memory. My prompt is fine. but database is quite big. so If I will go with all selection, this will come. I want to go with some different way. So that's why I am looking for this mail sending way. Can you help me with a suitable solution for this specific error.

 

Regards

Sourav Roy

Super User
Posts: 9,611

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to Sourav_sas

Determine the amount up to which the STP works; then, after the prompt has been given, check the values if they are still in executable range, and if not, display a message and restart the STP.

It's always better to avoid ERRORs in the first place than to wait for the crash. Just imagine the frustration if a user who waits 15 minutes just to get a "doesn't work". Much better to get "only X selections allowed" immediately.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 71

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to KurtBremser

Exactly, I am agree with you. I already discussed this option to higher authority. But as per them I can not do anything new with the prompt now, also we can not fix the output range also. Then I asked for this email option. They agree to this. I am using this code

%macro errmail; 

%if &syserr NE 0 %then %do; 

 

data _null_;

file myfile;

 put 'Your job received the following ERROR/WARNING message:'; 

 

put;

 put 'ERROR was:'; 

 put "&syserrortext"; 

 

put;

 put 'WARNING was:'; 

 put "&syswarningtext"; 

 

run;



%end; 

%mend errmail; 

 

And this is running smooth sending me mail. But when I am specifying the error instead of count like

 

filename myfile email                                                                                                                   
to= "EXTERN.ROY_SOURAV@ALLIANZ.COM"                                                                                                               
subject= "Error in Report"                                                                                                              
type= "text/plain";                                                                                                                      
                                                                                                                                        
%macro errmail;                                                                                                                         
 %if &syserr = "180-322: Statement is not valid or it is used out of proper order." %then %do;                                                                                                            
  data _null_;                                                                                                                          
   file myfile;                                                                                                                         
   put 'Your job received the following ERROR/WARNING message:';                                                                        
   put;                                                                                                                                 
   put 'ERROR was:';                                                                                                                    
   put "&syserrortext";                                                                                                                 
   put;                                                                                                                                 
   put 'WARNING was:';                                                                                                                  
   put "&syswarningtext";                                                                                                               
  run;                                                                                                                                  
 %end;                                                                                                                                  
%mend errmail;

I am not getting any mail. I feel due to not able to read the error not sending me mail. Can you help me with this?

 

Super User
Posts: 9,611

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to Sourav_sas

Maxim 1: Read the documentation, in this case the documentation for the automatic macro variable syserr, and its possible contents:

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a000208995.htm (9.2)

http://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.2&docsetId=mcrolref&docsetTarget=n1wr... (9.4)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 71

Re: How to send mail to the user or show any popup window if my output size is bigger than the locat

Posted in reply to KurtBremser

Can you tell me what is the reason behind, my second code given in the above comment not working? Any better suggestion you have I can complete my work more easily.

I will be grateful.

 

Regards

Sourav

Ask a Question
Discussion stats
  • 6 replies
  • 179 views
  • 0 likes
  • 2 in conversation