Skip to Content
0

Escape Character creating problem in BODS, tried all listed solutions so need help?

Jul 05, 2017 at 01:49 PM

63

avatar image
Former Member

Hi All,

When i run below script it prints extra \ in logs.

$FILE_NAME = 1;
print('C:\Users\shipar02\Desktop\SERVICES\[$FILE_NAME].txt');

OutPut

PRINTFN 05/07/2017 14:46:00 C:\Users\shipar02\Desktop\SERVICES\\1.txt

I want to get rid of extra \ (highlighted bold)which get inserted which create problem in exec function used later in Job.

And if I uses \\\, it prints all \\\ in print results.

Thanks,

Parijatam

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Doug Staub
Jul 05, 2017 at 08:07 PM
0

Hi,

What version of Data Services are you using and how is your variable defined? I ran a quick test in DS 4.2 SP8 with the following:

$FILE_NAME = 1;
print('C:\Users\shipar02\Desktop\SERVICES\[$FILE_NAME].txt');

and I don't see an extra \ printed in the trace. I tried using datatypes of varchar and int for the variable and it works correctly in both cases. Not exactly sure why you are seeing a different result.

Doug

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I am using DS 4.2, SP5.

$G_INFLDR= 'C:\Users\shipar02\Desktop\SERVICES\$FILE_NAME.txt';

Print ( [$G_INFLDR]);

Still prints

C:\Users\shipar02\Desktop\SERVICES\\1.txt

$FILE_NAME is integer variable and $G_INFLDR is varchar.

0