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
Is it possible to assign autoedit variables from sysout?
Re: Is it possible to assign autoedit variables from sysout?
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
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
Re: Is it possible to assign autoedit variables from sysout?
You could add the ctmvar -action set command in the code that is running instead of trying to parse the sysout.