Is it possible to assign autoedit variables from sysout?

All questions about Control-M jobs definitions
Post Reply
User avatar
Kenton
Nouveau
Nouveau
Posts: 15
Joined: 10 Oct 2008 12:00

Is it possible to assign autoedit variables from sysout?

Post by Kenton » 28 Jul 2014 8:29

Hello

Say I have a sysout that contains the line (amongst other things)
FILENUM=23

Is it possible to assign the number of files (23) to %%FileNum by reading the sysout somehow?

Thanks
Kenton

User avatar
piyush
Nouveau
Nouveau
Posts: 16
Joined: 05 Oct 2012 12:00

Re: Is it possible to assign autoedit variables from sysout?

Post by piyush » 27 Jan 2015 5:11

Hi,

yes it is possible in the following way.

Once the job that contains FILENUM=23 in sysout completes add a condition to 'SETGLOBALVAR' job. This SETGLOBALVAR job is one that you will create in Control-M for setting up the variable.
You will need to write a script which will do the following things:

1. Find the sysout on the agent server (I am not sure how sysouts are saved on your agent i.e. what naming convention is used but I believe order_id must be there which will be helpful in finding the sysout.)

2. Strip the line containing FILENUM=23 and then strip the value from string and store it in variable lets call it $FileNumVal

3. Now finally call ctmvar utility to set the variable value to %%FileNum. In your case it will look like this:
ctmvar -action set -var "%%\FileNum" -varexpr $FileNumVal

That's it. I could only think of this, if I get a better solution I'll post an update.

Regards,
Piyush

User avatar
jstarkw
Nouveau
Nouveau
Posts: 58
Joined: 14 Jan 2010 12:00

Re: Is it possible to assign autoedit variables from sysout?

Post by jstarkw » 30 Jan 2015 11:02

You could add the ctmvar -action set command in the code that is running instead of trying to parse the sysout.

Post Reply