Execute Command Stage in Sequencer Job
Moderators: chulett, rschirm, roy
The Director log result for Execute Command is
SequencerTest1..JobControl (@Execute_Command_12): Executed: printf $(<D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt>)
Reply=0
Output from command ====>
SequencerTest1..JobControl (@Execute_Command_12): Checkpointed execution of command 'printf $(<D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt>)'
and Job parameter Data Type in Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1 is String....
SequencerTest1..JobControl (@Execute_Command_12): Executed: printf $(<D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt>)
Reply=0
Output from command ====>
SequencerTest1..JobControl (@Execute_Command_12): Checkpointed execution of command 'printf $(<D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt>)'
and Job parameter Data Type in Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1 is String....
Thanx
Jaya
Jaya
Do not use closing angle bracket in printf. Try printf or cat command with tr.
Or
Code: Select all
printf "$(<D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt)"
Code: Select all
cat D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt | tr -d '\n'
You are the creator of your destiny - Swami Vivekananda
Anbu,
I modified the sequential file settings so that I am getting
SequencerTest1..JobControl (@Execute_Command_12): Executed: cat D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt | tr -d '\n'
Reply=0
Output from command ====>
2010-05-26 03:34:44
now I got this in sequence job. But still same in error is coming from the
job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1
SQLServer_Enterprise_0,0: [IBM (DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Conversion failed when converting datetime from character string.
I modified the sequential file settings so that I am getting
SequencerTest1..JobControl (@Execute_Command_12): Executed: cat D:\DataFiles\ETL_DEV_Seq_Files\Policy_MaxModelDate.txt | tr -d '\n'
Reply=0
Output from command ====>
2010-05-26 03:34:44
now I got this in sequence job. But still same in error is coming from the
job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1
SQLServer_Enterprise_0,0: [IBM (DataDirect OEM)][ODBC SQL Server Driver][SQL Server]Conversion failed when converting datetime from character string.
Thanx
Jaya
Jaya
I am not sure whether tr command removes newline character.
Just pass first 19 chars to your job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1 from sequence job
Just pass first 19 chars to your job Px_Etl_Unld_Pc_PolicyPeriod_TodaysDate1 from sequence job
Code: Select all
ExecuteCmd.$CommandOutput[1,19]
You are the creator of your destiny - Swami Vivekananda
The return value is actually a dynamic array, so one other solution would be to take just the first element from it:
Another would be to strip the Field Mark that is added to the return value:
Both of those solutions would be size / datatype 'agnostic'.
Code: Select all
ExecuteCmd.$CommandOutput<1>
Code: Select all
Convert(@FM,"",ExecuteCmd.$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: 13
- Joined: Wed Feb 24, 2010 9:41 am
Execute Command
chulett wrote:The return value is actually a dynamic array, so one other solution would be to take just the first element from it:
Another would be to strip the Field Mark that is added to the return value:Code: Select all
ExecuteCmd.$CommandOutput<1>
Both of those solutions would be size / datatype 'agnostic'.Code: Select all
Convert(@FM,"",ExecuteCmd.$CommandOutput)
What if we want to output a integer value using Execute Command... Do we need to use ExecuteCmd.$CommandOutput or ExecuteCmd.$ReturnValue.
ExecuteCmd.$CommandOutput or ExecuteCmd.$ReturnValue depends upon how you return 2 from your script.
If your script returns value using any command like echo or printf then use ExecuteCmd.$CommandOutput else if you return value using return then use ExecuteCmd.$ReturnValue.
If you are using command output, then make sure you delete newline char at the end of your output or use printf command.
If your script returns value using any command like echo or printf then use ExecuteCmd.$CommandOutput else if you return value using return then use ExecuteCmd.$ReturnValue.
If you are using command output, then make sure you delete newline char at the end of your output or use printf command.
You are the creator of your destiny - Swami Vivekananda
-
- Premium Member
- Posts: 13
- Joined: Wed Feb 24, 2010 9:41 am
Thanks for your reply anbu
I am using Cat filename.txt to read a integer value in text file into a job parameter for the next job activity stage. For date datatype the solution you told above is working fine. For integer how to delete that new line char? Do we need to use anything other that Cat for integer datatype like Printf or echo?
I am using Cat filename.txt to read a integer value in text file into a job parameter for the next job activity stage. For date datatype the solution you told above is working fine. For integer how to delete that new line char? Do we need to use anything other that Cat for integer datatype like Printf or echo?
Read the file using printf command
Or
You can run the script which has
Code: Select all
printf $(< filename)
You can run the script which has
Code: Select all
printf 2
You are the creator of your destiny - Swami Vivekananda
-
- Premium Member
- Posts: 13
- Joined: Wed Feb 24, 2010 9:41 am
The job is getting failed throwing me these errors
Seq_Load_TQC05_POLICY..JobControl (@Execute_Command_43): Executed: printf $(<D:\DataFiles\ETL_DEV_MaxSurrKeyFiles\TQC05_POLICY_Max_SRC_SYS_ID.txt)
Reply=1
Output from command ====>
The system cannot find the file specified.
Seq_Load_TQC05_POLICY..JobControl (@Job_Activity_46): Controller problem: Error calling DSSetParam(Jp_MaxSrcSysID), code=-4
[ParamValue/Limitvalue is not appropriate]
Seq_Load_TQC05_POLICY..JobControl (@Execute_Command_43): Executed: printf $(<D:\DataFiles\ETL_DEV_MaxSurrKeyFiles\TQC05_POLICY_Max_SRC_SYS_ID.txt)
Reply=1
Output from command ====>
The system cannot find the file specified.
Seq_Load_TQC05_POLICY..JobControl (@Job_Activity_46): Controller problem: Error calling DSSetParam(Jp_MaxSrcSysID), code=-4
[ParamValue/Limitvalue is not appropriate]
-
- Premium Member
- Posts: 13
- Joined: Wed Feb 24, 2010 9:41 am