BookmarkSubscribeRSS Feed
sas_pkc1
Fluorite | Level 6

Dear All,

 

I am trying to incorporate the status handling in that i am using the SEND ENTRY TO DATASET, i have created and registered one STATUS named dataset in that library. which is empty table having no column.

can you please tell me which column it should contains?

can you please provide sample for DATASET which i can use for building columns?

 

Thanks & Regards,

Prashant.

 

4 REPLIES 4
BrunoMueller
SAS Super FREQ

Hi

 

Have a look at the generated code, see example below. You will see that the dataset created has two columns:

message, character, length 80

dateTime, numeric

 

This SAS dataset is appended to the one you specified when defining the action.

 

Please make sure that the libref is available that you specified when defining the action information for the "SEND ENTRY TO DATASET". in order for you to look at the data from within Data Integration Studio, the SAS Dataset has to be registered in the Metadata.

 

 

 %macro etls_sendData(libref=, dataset=, message=); 
      
         %local etls_syntaxcheck; 
         %let etls_syntaxcheck = %sysfunc(getoption(syntaxcheck)); 
         /* Turn off syntaxcheck option to perform following steps  */ 
         options nosyntaxcheck;
      
         data work.etls_tempData; 
            length message $80; 
            message = "&message."; 
            datetime = put(datetime(),nldatm.); 
         run; 
      
         %local etls_obs; 
         %let etls_obs = %sysfunc(getoption(obs)); 
         /* Set obs option to max to perform following steps  */ 
         options obs = max;
      
         proc append base=&libref..&dataset. data=work.etls_tempData force;   run; 
      
         /* Reset obs option to previous setting  */ 
         options obs = &etls_obs; 
      
         proc datasets lib = work nolist; 
            delete etls_tempData; 
         quit;
      
         /* Reset syntaxcheck option to previous setting  */ 
         options &etls_syntaxcheck; 
      %mend etls_sendData; 
      %etls_sendData 
         (libref = ditstsrc, 
          dataset = dis_job_status, 
          Message = Successful); 

Bruno

 

Ps Have moved the discussion to the appropriate community

arjun2
Calcite | Level 5

Hi

 

I have many jobs and each job needs to have status handling. I am trying to get the error message of each job into a dataset. But I am facing problems with the maximum length of error message that can be passed on to the table.

 

In the code generated, length of MESSAGE column in etls_tempData table is only 80. If i save the name of job and the error message into the message column. The error message will not be complete.

 

         data work.etls_tempData; length message $80;
            message = "&message.";
            datetime = put(datetime(),nldatm.);
         run;

                 

I was checking if there is any option to increase the length of Error Message which is passed to the Dataset.

              

Thanks,

Arjun

BrunoMueller
SAS Super FREQ

Hi in the status ahndling you can also define "custom", this will allow you to run any code you want.

 

You can model your code similar to the one used by the "SEND ENTRY TO DATASET" then you have all the flexibility you need.

 

You should package the code into a autocall macro, so you can change or extend the code without actually change the call to the macro.

 

Also have a look at the condition send job status, this might be helpful as well

 

Bruno

arjun2
Calcite | Level 5

Thanks! This helps 🙂

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1464 views
  • 0 likes
  • 3 in conversation