BookmarkSubscribeRSS Feed
HannaSinger
Calcite | Level 5

Hello,
I'm developing a process in Data Integration Studio 4.905.
The goal is to get a set of transformations, where the first part is a group of loop transformations which can fail and the last transformation should send an email with the status of the failure.
The mail should contain a text message in the subject and a table with some data in the mail body.
The process doesn't work completely as it supposed to. The mail is being sent, but only the mail subject is available without the data table in the mail body. 
Once the process finishes and I run only the last transformation, the mail is being sent completely together with the data table.


The data table is printed by means of proc print.
I can see in the log that in case that all transformations are running together, the proc print doesn't deliver any observation, but once the last transformation runs alone, the observations are being read.
Any advice, how can I get the proc print delivering all the observations when all transformations are running? 

In the meantime, I found a workaround. I’m selecting all values of the relevant column in the data table separated by comma  into a macro variable and using this macro variable withing proc odstext for mail creation. It works, but the solution is not very satisfying.

Thank in advance for any idea.

8 REPLIES 8
Patrick
Opal | Level 21

I don't really understand how your process/flow looks like but based on your description it sounds like a timing issue. Make sure that your error check/send email step is outside of the loop (especially when running in parallel). 

HannaSinger
Calcite | Level 5

Thanks Patrick for your reply.
Yes, the send mail step is outside of the loop and the process is running sequentially.
The issue is:
When there is no error in the loop' everything is fine and the email contains the subject and the data table in the mail body,
but once there is an error in the loop the email is not complete - it contains the subject but doesn't contain the data table. I noticed that it happens because of the proc print which is printing the table and doesn't retrieve any observations in case of a failure in the loop

LinusH
Tourmaline | Level 20

Se eaprt of the log (the error and then the email/proint) might help us to understand.

A guess, some errors make SAS go into syntax check mode, and sets obs=0.

Data never sleeps
HannaSinger
Calcite | Level 5

Thanks!
Yes, indeed. There is a NOTE OBS=0, enabling syntax check mode
in the log with the failure.
Because of the custom data I cannot send the whole log.
Is there a possibility to force the system not to get to the syntax check mode in the specific run?

Patrick
Opal | Level 21

I’d ask what’s causing this error in first place. Ideally you’ve got some error handling in your job so it doesn’t go into syntax check mode. 

If an error situation doesn’t cause this table to not even get populated then you could of course also set options obs=max for the portion of your code where you create and send the email using some code along the line of below (not tested, but syntax will be at least close to working).

%let sv_obs=%sysfunc(getoption(obs,keyword));
Options obs=max;
/* here your code for the email */
Options &sv_obs;
HannaSinger
Calcite | Level 5

Unfortunately, It didn't work.
So for now I will stay with the workaround, using the proc odstext  

Patrick
Opal | Level 21

@HannaSinger If confidentiality allows share the whole DIS generated code as attachment.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 462 views
  • 1 like
  • 3 in conversation