Hi All,
I am calling a Datastage parallel job repeatedly while passing a char string with spaces as parameter. I want to use this parameter in SQL as part of condition check for a column in Teradata Connector. If the parameter has one word it is working fine. if it has two or more words, the job is failing with an Unrecognized argument: 'rest or the string variable'. I believe the string after the first space in the parameter value is being treated as additional argument. how to over come this?
Thank You,
Vijay
how to pass string with spaces to Teradata Connector stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 4
- Joined: Tue Oct 17, 2017 12:49 pm
-
- Participant
- Posts: 4
- Joined: Tue Oct 17, 2017 12:49 pm
Additional Info
My input is from a file as below
'ROBO0001 ADD'
'ROBO0002 ADD'
'ROBO0003ADD'
I am reading these values into a unix variable and passing it to my parallel job which has a Teradata BTEQ script as before EXECSH. the Bteq is getting the value correctly. But in the job I have a Teradata connector where I am executing a before SQL as below
Delete from DB1.TableName where ROBO_ID = '#ROBOID#';
3rd value from the list of values works fine as it has no spaces in the value.
But, the first two fail with the message mentioned in my original post. The file has single quote as mentioned above to make able to pass as a value to dsjob from unix. Please let me know if you need any more values.
'ROBO0001 ADD'
'ROBO0002 ADD'
'ROBO0003ADD'
I am reading these values into a unix variable and passing it to my parallel job which has a Teradata BTEQ script as before EXECSH. the Bteq is getting the value correctly. But in the job I have a Teradata connector where I am executing a before SQL as below
Delete from DB1.TableName where ROBO_ID = '#ROBOID#';
3rd value from the list of values works fine as it has no spaces in the value.
But, the first two fail with the message mentioned in my original post. The file has single quote as mentioned above to make able to pass as a value to dsjob from unix. Please let me know if you need any more values.
VIJAYDASARI77
Okay. Typically that would be the best way to do what you are doing - put the single quotes in the SQL around the parameter name so you don't need to pass them in with the parameter value. A bit surprised it's not working well for you.
It sounds like you are doing both, meaning single quotes are part of the parameter value being passed in? Or are they just part of your command line syntax? It sounds like you are using dsjob to start the job and then "-param" to pass in these name/value pairs, is that correct?
I'm thinking we may need to see the dsjob syntax you are using. Also, please post the unedited error message from the job.
It sounds like you are doing both, meaning single quotes are part of the parameter value being passed in? Or are they just part of your command line syntax? It sounds like you are using dsjob to start the job and then "-param" to pass in these name/value pairs, is that correct?
I'm thinking we may need to see the dsjob syntax you are using. Also, please post the unedited error message from the job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 4
- Joined: Tue Oct 17, 2017 12:49 pm
Hi Chulett,
Here is my dsjob statement
${DS_BIN_DIR}/dsjob -run -param ROBO_ID="${ROBOID}" -wait ${DS_RDW_PROJECT} ${JOB_NAME}
I am enclosing my data in the file between single quotes as unix is not reading complete string.
Here is my full error msg.
load_ANNOTATION_WB_SN: Unrecognized argument: ADD';]]><FailOnError modified='1' type='bool'><![CDATA[1]]></FailOnError></before><after modified='1' type='string'><FailOnError type='bool'><![CDATA[1]]></FailOnError></after><beforeNode type='string'><![CDATA[]]><FailOnError modified='1' type='bool'><![CDATA[1]]></FailOnError></beforeNode><afterNode type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></afterNode><BeforeSQLFile type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></BeforeSQLFile><AfterSQLFile type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></AfterSQLFile></BeforeAfter><BulkAccess><LoadType modified='1' type='int'><![CDATA[1]]></LoadType><ErrorTable1 modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_ET]]></ErrorTable1><ErrorTable2 modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_UV]]></ErrorTable2><LogTable modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_LG]]></LogTable><WorkTable modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_WK]]></WorkTable><StartMode modified='1' type='int'><![CDATA[1]]></StartMode><CleanupMode type='int'><![CDATA[1]]></CleanupMode><Sleep type='int'><![CDATA[0]]></Sleep><Tenacity type='int'><![CDATA[0]]></Tenacity><ErrorLimit modified='1' type='int'><![CDATA[0]]></ErrorLimit></BulkAccess><LimitSettings><MaxSessions type='int'><![CDATA[0]]></MaxSessions><MaxPartitionSessions type='int'><![CDATA[0]]></MaxPartitionSessions><MinSessions type='int'><![CDATA[0]]></MinSessions><MaxBufferSize type='int'><![CDATA[0]]></MaxBufferSize><StartRow type='int'><![CDATA[0]]></StartRow><EndRow type='int'><![CDATA[0]]></EndRow><ProgressInterval modified='1' type='int'><![CDATA[2000000]]></ProgressInterval></LimitSettings><ParallelSynchronization collapsed='1' type='bool'><![CDATA[0]]></ParallelSynchronization><TMSMEVENTS collapsed='1' type='bool'><![CDATA[0]]></TMSMEVENTS><Disconnect collapsed='1' type='int'><![CDATA[0]]></Disconnect></Usage></Properties >
load_ANNOTATION_WB_SN: SAX parser exception thrown: The input ended before all started tags were ended. Last tag started was 'before' (CC_PropertySet::fatalError, file CC_PropertySet.cpp, line 2,236)
load_ANNOTATION_WB_SN: Error occurred during initializeFromArgs().
Error occurred during initializeFromArgs().
Here is my dsjob statement
${DS_BIN_DIR}/dsjob -run -param ROBO_ID="${ROBOID}" -wait ${DS_RDW_PROJECT} ${JOB_NAME}
I am enclosing my data in the file between single quotes as unix is not reading complete string.
Here is my full error msg.
load_ANNOTATION_WB_SN: Unrecognized argument: ADD';]]><FailOnError modified='1' type='bool'><![CDATA[1]]></FailOnError></before><after modified='1' type='string'><FailOnError type='bool'><![CDATA[1]]></FailOnError></after><beforeNode type='string'><![CDATA[]]><FailOnError modified='1' type='bool'><![CDATA[1]]></FailOnError></beforeNode><afterNode type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></afterNode><BeforeSQLFile type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></BeforeSQLFile><AfterSQLFile type='string'><![CDATA[]]><FailOnError type='bool'><![CDATA[1]]></FailOnError></AfterSQLFile></BeforeAfter><BulkAccess><LoadType modified='1' type='int'><![CDATA[1]]></LoadType><ErrorTable1 modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_ET]]></ErrorTable1><ErrorTable2 modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_UV]]></ErrorTable2><LogTable modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_LG]]></LogTable><WorkTable modified='1' type='string'><![CDATA[TEST_ERR_DB.ANNOTATION_WB_SN_WK]]></WorkTable><StartMode modified='1' type='int'><![CDATA[1]]></StartMode><CleanupMode type='int'><![CDATA[1]]></CleanupMode><Sleep type='int'><![CDATA[0]]></Sleep><Tenacity type='int'><![CDATA[0]]></Tenacity><ErrorLimit modified='1' type='int'><![CDATA[0]]></ErrorLimit></BulkAccess><LimitSettings><MaxSessions type='int'><![CDATA[0]]></MaxSessions><MaxPartitionSessions type='int'><![CDATA[0]]></MaxPartitionSessions><MinSessions type='int'><![CDATA[0]]></MinSessions><MaxBufferSize type='int'><![CDATA[0]]></MaxBufferSize><StartRow type='int'><![CDATA[0]]></StartRow><EndRow type='int'><![CDATA[0]]></EndRow><ProgressInterval modified='1' type='int'><![CDATA[2000000]]></ProgressInterval></LimitSettings><ParallelSynchronization collapsed='1' type='bool'><![CDATA[0]]></ParallelSynchronization><TMSMEVENTS collapsed='1' type='bool'><![CDATA[0]]></TMSMEVENTS><Disconnect collapsed='1' type='int'><![CDATA[0]]></Disconnect></Usage></Properties >
load_ANNOTATION_WB_SN: SAX parser exception thrown: The input ended before all started tags were ended. Last tag started was 'before' (CC_PropertySet::fatalError, file CC_PropertySet.cpp, line 2,236)
load_ANNOTATION_WB_SN: Error occurred during initializeFromArgs().
Error occurred during initializeFromArgs().
VIJAYDASARI77
That's... unexpected. Not sure why you'd see an error message like that or why a SAX parser would be involved. Smells buggy to me, in your shoes I would involve your official support provider. Unless someone wanders along that's seen that kind of failure before and knows how to deal with it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 4
- Joined: Tue Oct 17, 2017 12:49 pm