BookmarkSubscribeRSS Feed
Citrine10
Obsidian | Level 7

Hi there

I have jobs that run sas scripts on IBM Flow manager. Is there a way for me to save a tabular log of the jobs? For example, save the logs in a sas table.

 

 

5 REPLIES 5
Amir
PROC Star

Hi @Citrine10,

 

I've not used IBM flow manager, but as a guess, could you create an extra SAS process after all your processes that reads the previous log files and save them as SAS data sets?

 

 

Kind regards,

Amir.

SASKiwi
PROC Star

What do you mean "a tabular log of the jobs"? Are you referring to the SAS logs generated by your SAS scripts or something else? These will be typically written to a specific job log folder as text files where they can be easily viewed. Are you wanting to parse logs for monitoring performance or some other reason?

Citrine10
Obsidian | Level 7
These are the logs from the scheduled jobs. I found them in a log folder
Amir
PROC Star

Hi @Citrine10,

 

Not knowing your exact set-up, the below untested macro (when called) reads a file and writes it as is to a SAS data set. You'll obviously have to change "default-log-path" to your own, assuming you have one.

 

As @SASKiwi mentioned, why do you think you need the log files saved as SAS data sets? If this is an access issue then your administrator should be able provide you with what you need.

 

/* define macro to read a log file and output it to a data set */
%macro log2ds(log_file                    /* name of log file */
             ,ds_name                     /* name of data set */
             ,log_path = default-log-path /* path to log file */
             )

   data &ds_name;
      infile "&log_path/&log_file";
      input;
      put _infile_;
   run;
%mend log2ds;


/* example call #1 using default path */
%log2ds(validation.txt, log_lib.validation);


/* example call #2 using non-default path */
%log2ds(report.txt, log_lib.report, log_path = non-default-log-path);

 

 

Kind regards,

Amir.

SASKiwi
PROC Star

It's still unclear why you want to read them into SAS tables. If you just want to monitor the jobs or see a history of what has run then IBM Flow Manager does that.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 721 views
  • 0 likes
  • 3 in conversation