Extracting files from unix
Moderators: chulett, rschirm, roy
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.
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.
Did you type that in by hand or use the External Parameter Helper to populate it for you? If the former, do the latter.times29 wrote:Then under seq_all for job2 job actvity for parameters name input_file_name i gave expression value "job1.$CommandOutput"
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 730
- Joined: Tue Nov 04, 2008 10:14 am
- Location: Bangalore
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.
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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
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
-
- Participant
- Posts: 31
- Joined: Mon Jun 28, 2010 5:15 am
- Location: pune
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.![Smile :)](./images/smilies/icon_smile.gif)
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.
![Smile :)](./images/smilies/icon_smile.gif)