cancel
Showing results for 
Search instead for 
Did you mean: 

try to create file in location

former_member203645
Active Participant
0 Kudos

Please help me with command fix,

I am trying to create a file after cycle completing in location.

Below is the command using in the script :

print('Attempting to create [$GV_OUTBOUND_DIR][$GV_FILE_NAME]');

print(exec('/bin/sh','-c "touch [$GV_OUTBOUND_DIR]/[$GV_FILE_NAME]"',8));

Variables :

$GV_OUTBOUND_DIR] - added path O:\Project\++Projects\Cube\ETL_Unit_test


[$GV_FILE_NAME] - File name with extension, eg: FILEGEN.txt



Error Message:



25023353486624PRINTFN6/20/2016 2:37:37 AMAttempting to create O:\Project\++Projects\Cube\ETL_Unit_testFILEGEN.txt
25023353486624PRINTFN6/20/2016 2:37:37 AM1: touch: cannot touch `O:Project++ProjectsCubeETL_Unit_test/FILEGEN.txt': No such file or directory




Accepted Solutions (0)

Answers (1)

Answers (1)

former_member187605
Active Contributor
0 Kudos

\ is the escape character in DS scripting.

Replace any \ by \\.

former_member203645
Active Participant
0 Kudos

I replaced \ with \\  but I think I am still missing something, it not generating file

print('Attempting to create [$GV_OUTBOUND_DIR][$GV_FILE_NAME]');

print(exec('/bin/sh','-c "touch [$GV_OUTBOUND_DIR]\\[$GV_FILE_NAME]"',8));

[$GV_OUTBOUND_DIR]  O:\Project\++Projects\Cube\ETL_Unit_test


[$GV_FILE_NAME] FILEGEN.txt


Error message:

284453815888672PRINTFN6/20/2016 8:11:07 AMO:\Project\++Projects\Cube\ETL_Unit_test
284453815888672PRINTFN6/20/2016 8:11:07 AMFILEGEN.txt
284453815888672PRINTFN6/20/2016 8:11:07 AMAttempting to create O:\Project\++Projects\Cube\ETL_Unit_testFILEGEN.txt
284453815888672PRINTFN6/20/2016 8:11:07 AM0:
284453815888672JOB6/20/2016 8:11:08 AMJob <JB_CYCLECOMPLETE> is completed successfully.
0 Kudos

Hi,

Can you check this?

[$GV_OUTBOUND_DIR]  O:\\Project\\++Projects\\Cube\\ETL_Unit_test\\


[$GV_FILE_NAME] FILEGEN.txt



BR,

Srinivasan.

former_member203645
Active Participant
0 Kudos

nope it didn't worked.

former_member187605
Active Contributor
0 Kudos

Yes, I see, now. You're trying to create a file using a Linux command. And you're using a Windows path.

That will never work, will it?