Page 2 of 2

Posted: Sun Apr 17, 2011 2:25 pm
by chulett
Close... you need to create a job parameter in 'job 2', use it for the filename and then assign $CommandOutput to that parameter in the Job Activity stage.

Posted: Sun Apr 17, 2011 7:16 pm
by times29
Getting error below

seq_all calls job1 and job2

job1 return 0
Output from command ====>
/aa/test/aa_201005051223400386_test1.csv

so for job2
Under job properties i gave parameter name input_file_name string default value blank

Then under seq_all for job2 job actvity for parameters name input_file_name i gave expression value "job1.$CommandOutput"

I am getting error (for job2)

$CommandOutput : No such file or directory.

Posted: Sun Apr 17, 2011 9:30 pm
by chulett
times29 wrote:Then under seq_all for job2 job actvity for parameters name input_file_name i gave expression value "job1.$CommandOutput"
Did you type that in by hand or use the External Parameter Helper to populate it for you? If the former, do the latter.

Posted: Mon Apr 18, 2011 4:07 am
by zulfi123786
In the job where you want to read the file using seq file stage, use a parameter say "xxx" and you set the file name in seq file stage as <path>/#xxx#.

And in the sequencer where you set the values for parameters of the job you set the value for xxx=$CommandOutput

Posted: Mon Apr 18, 2011 6:38 am
by chulett
Again, close. In the Sequence's Job Activity, you set the value of the parameter to ExecuteStageName.$CommandOutput which is what the helper would build for you. With the appropriate stage name substituted in, of course.

The next issue will be the fact that the parameter's value will be 'inappropriate' because of the @FM / Field Marks in the returned dynamic array. However, that's been asked and answered so many times here that a reasonable search should turn the full answer up rather easily.

Posted: Mon Apr 18, 2011 7:31 am
by times29
JobControl (@job1): Executed: ls -1 test/aa/*.csv | sort -nt_ -k2.1,2.6 | tail -1
Reply=0
Output from command ====>
test/aa/test_201005051223400386_test.csv
---------------this step is good now while passing this value to job2 i am getting error file not found

job1 -> (Src_xxx): Job run requested
Mode (row/warn limits) = 0/0
Job Parameters --->
$DATA_DIR=/opt/IBM/InformationServer/aa/Data/
OUTPUT_FILE_NAME=tmp_xxx
INPUT_FILE_NAME=XXX=$CommandOutput ---------------(Issue with this command)
DSJobController=job1

Posted: Mon Apr 18, 2011 7:49 am
by chulett
Answer this:
chulett wrote:Did you type that in by hand or use the External Parameter Helper to populate it for you? If the former, do the latter.
The "helper" is under the ellipsis (...).

Posted: Mon Apr 18, 2011 8:45 am
by times29
ellipsis (...).

Posted: Tue May 03, 2011 1:55 am
by deeplind07
Hi,
This is the first time i am posting anything on DSex.

1. Cat > Latest_file.sh
cp `ls -1 *.csv | sort -n -t"_" -k 2.1,2.6|tail -1` Latest_file.csv

2. Call this .sh file in the before job sub routine or in an execute command stage.

3. Then in the file stage add file name=Latest_file.csv

PLease let me know if this helped. :)

Posted: Tue May 03, 2011 6:18 am
by chulett
I guess we'll see... hopefully by now they've got it sorted out, however. :wink: