Use of Variables in paths including \

All questions about Control-M jobs definitions
Post Reply
User avatar
BreakFix
Nouveau
Nouveau
Posts: 30
Joined: 24 Sep 2009 12:00

Use of Variables in paths including \

Post by BreakFix » 04 Nov 2011 5:26

Hi Folks.
CTM 6.4.0.1, all the lastest service packs on Wintel.

I'm tearing my hair out here, please help. :oops:
I am trying to specify an output folder for a report using variables to distribute the reports into sub folders... so the path looks like this:

\\server01\E$\reports\2011\11\...
I have used
\\server01\E$\reports\%%A\%%B\

with SET variables:
%%A = %%$YEAR
%%B = %%MONTH


however the variables generate CTMERR messages like this
\\server01\E$\reports\CTMERRA\CTMERRB\

If i place spaces between the variables and the \ then it's fine but it's no longer a value path.
\\server01\E$\reports\2011 \11 \

I believe this because\ symbol is an escape or system reserved charater causing the variable to become incorrect... but how else do you create variable paths?

I have tried using "" and '' as discussing in another post with no success.
Can anyone help? Is my approach wrong?
/BreakFix

User avatar
Phils
Nouveau
Nouveau
Posts: 7
Joined: 28 May 2008 12:00

Post by Phils » 05 Nov 2011 9:26

Hi BreakFix,

You can't have a \ after your variables

Instead of:


\\server01\E$\reports\%%A\%%B\

Try this:

\\server01\E$\reports\%%A/%%B
Last edited by Phils on 05 Nov 2011 9:42, edited 1 time in total.

User avatar
BreakFix
Nouveau
Nouveau
Posts: 30
Joined: 24 Sep 2009 12:00

Post by BreakFix » 05 Nov 2011 10:08

Thanks for replying over the weekend :P
Working on a Wintel environment I had not thought to try a / .
I will give it a go ASAP.
/BreakFix

User avatar
matom
Nouveau
Nouveau
Posts: 37
Joined: 29 Nov 2006 12:00
Location: Ile de France

Post by matom » 06 Nov 2011 4:06

Hi BreakFik,

Add a point after variable name, like below.

\\server01\E$\reports\%%A.\%%B.\

Regards

User avatar
BreakFix
Nouveau
Nouveau
Posts: 30
Joined: 24 Sep 2009 12:00

Post by BreakFix » 07 Nov 2011 10:26

Thanks Phils and Maton.

I confirm that using a / or . have worked independantly.

Examples:
.... \TEST\%%D/%%C/Daily Non-Prod ....
.... \TEST\%%D.\%%C.\Daily Non-Prod ....


Now i need to read the parameter guide again and figure out what i missed.
Thanks a lot guys!

/BreakFix
/BreakFix

User avatar
Hagar
Nouveau
Nouveau
Posts: 27
Joined: 19 Feb 2009 12:00

Post by Hagar » 07 Nov 2011 11:32

Hi!

Your problem is that control-M don't know where your variable ends.
The dot tells ctm "end of variable"

like if you want a date and timestamp you use

%%DATE.%%TIME. this gives 1111071131
if you want the timestamp as 111107.1131 you use
%%DATE..%%TIME

Post Reply