Tully, Smart Folder variable should be defined upon completion of this job. What is missing is your use of the variable, e.g. use %%FileName in command line of next job.
MK, is your job in a Smart Folder?
Check that your agents are also on the same version! It may still be V8. That could be the reason why you don't see the SMART Folder Variable as an option.
Thanks for looking into my issue.
I expected the variable to be defined at job completion and I set up a post processing command to echo that value. If you look at the job's output that I included, you can see the echo statement value is "CTMERR\FileName" meaning CTM could not/would not resolve it.
When Control-M job is sent to agent for execution, all Control-M variables in the job have already been resolved. Agent will launch a process to execute pre-command, job command and post-command exactly as what it has received.
Job Post Processing happens after agent has returned job execution status back to Control-M. By that time, the process at agent to execute pre-command, job command and post-command has terminated.
For command to include variable defined/updated in job Post Processing, command can only be in a job submitted afterward.
Hope this helps.
I'm confused! Am I not defining the SMART Folder variable FileName from the output of the job? Consequently, I would expect it to be resolved in post processing.
I want to think I had the same exact issue when capturing output into a Smart Folder variable. If I recall correctly you have to have the Smart Folder variable defined in the Properties of your Smart folder, and then as local variable for any job that wants to use it. If get a chance I'll dig to see if I can find some examples.
You are correct that variable has been defined from the output. This Post-Processing action happens after pre-command, job command and post-command have been completed. Post-processing action parses job output holding everything from all these "commands".
May be I have confused you by using the commonly-known and abbreviated terms. If you look at the full text at job definition form (see below screenshot), the fields labelled as "Pre-execution Command" and "Post-execution Command" are what I have been referring as pre-command and post-command respectively. The pre- and post- are relative to execution of job command. They are not relative to job processing as you have written (and interpreted as such).
Additionally, variables in job definition are resolved at the time immediate before job is submitted to agent. Agent receives pre-command, job command and post-command as resolved text and and at the same time. Agent won't know anything about variables defined in those "commands".
That would be great if you could dig out a solution. I'm starting to wonder if anybody has gotten it to work.
As pointed out by George, I have indeed made the silly mistake of defining the job in a regular folder.
Did you try to "use" the variable using %%\\FILENAME? Try changing it to %%FILENAME instead. Local, SMART folder and global variables uses the same convention %%<VAR NAME> when using it. It's different from when they are being "assigned" where SMART folder variable will have a %%\\ prefix and global variable will have a %%\ prefix. Variable will be resolved in the following order: local->SMART folder->global. if the local variable is not found, Control-M looks for it in the SMART folder and so on. Therefore, you must make sure you don't a local variable with the same name as the SMART folder variable if you intend to make use of SMART folder variable.
The only exception is a named pool variable. It's assigned using %%\\<pool name>\ prefix and this prefix has to be included when it's used.
I call the variable in the next job in the SMART folder as %%FileName but it resolves to CTMERR\%%FileName which tells me it nevr gets set.