Page 3 of 3

Posted: Thu Apr 25, 2013 7:39 am
by chandra.shekhar@tcs.com

Code: Select all

find /data/finrecon/SBIRECON/`echo "#$JpBusinessDate#" | tr -d '-'`/GLCCCTA*
OR
ls /data/finrecon/SBIRECON/`echo "#$JpBusinessDate#" | tr -d '-'`/GLCCCTA*
The actual path is
/data/finrecon/SBIRECON/20130419/GLCCCTA*
And I am passing Business Date as 2013-04-19.
I have modified the 1st code as it was not working correctly.
The 2nd code I have pasted same as that of Eric's.

Posted: Thu Apr 25, 2013 7:49 am
by BI-RMA
Hi Chandra,

I believe the important word you missed in eph's post is
"or".

You were not supposed to apply both. This is why DataStage tells You that it does not know what to do with "ls".

Posted: Thu Apr 25, 2013 7:53 am
by chandra.shekhar@tcs.com
@Roland
Yes, I am not using both of them, I have tried them separately. :(

Just wanted to let you all know that as I have told earlier that I am able to view the data from the stage, that means I have used the code correctly.
But while running the job.. :cry:

Posted: Thu Apr 25, 2013 8:44 am
by eph
Could you try to put the commands in a Before-job subroutine ExecSH? and add a ";echo TEST" at the end

Like:

Code: Select all

ls /data/finrecon/SBIRECON/`echo "#$JpBusinessDate#" | tr -d '-'`/GLCCCTA*;echo TEST
And give us the result like:

Code: Select all

testSF_CommandLine..BeforeJob (ExecSH): Executed command: ls /app/EQOPIGL/PFI/EROPIGL1/operis/integration/`echo 2013-04-25 | tr -d '-'`/testLS*;echo "TEST"
*** Output from command was: ***
/app/EQOPIGL/PFI/EROPIGL1/operis/integration/20130425/testLS.txt
/app/EQOPIGL/PFI/EROPIGL1/operis/integration/20130425/testLS.txt2
TEST
I'm quite surprised that the first command fails:

Code: Select all

testSF_CommandLine..BeforeJob (ExecSH): Executed command: find /app/EQOPIGL/PFI/EROPIGL1/operis/integration/`echo 2013-04-25 | tr -d '-'` -name "*testLS*";echo "TEST"
*** Output from command was: ***
/app/EQOPIGL/PFI/EROPIGL1/operis/integration/20130425/testLS.txt2
/app/EQOPIGL/PFI/EROPIGL1/operis/integration/20130425/testLS.txt
TEST
Eric

Posted: Thu Apr 25, 2013 1:19 pm
by chandra.shekhar@tcs.com
@Eric,
I have fired these commands on the server through putty and I got expected result in both cases.
That means the commands are working absolutely fine.
For your confirmation, the output of these commands is the list of the files which are to be read in the stage.
The o/p of the commands when used in BeforeJob subroutine ExecSH is :-
1)

Code: Select all

Executed command: find /data/finrecon/SBIRECON/`echo "20130420" | tr -d '-'`/GLCCCTA*;echo "TEST" 
*** Output from command was: *** 
/data/finrecon/SBIRECON/20130420/GLCCCTA_01.txt 
/data/finrecon/SBIRECON/20130420/GLCCCTA_02.txt
TEST
2)

Code: Select all

Executed command: ls /data/finrecon/SBIRECON/`echo "20130420" | tr -d '-'`/GLCCCTA*;echo "TEST" 
*** Output from command was: *** 
/data/finrecon/SBIRECON/20130420/GLCCCTA_01.txt 
/data/finrecon/SBIRECON/20130420/GLCCCTA_02.txt
TEST
Everything is working correctly, still I doesnt understand why the job is not able to read the last row :cry: