Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
FLAG=0
InRowCount=0
OutRowCount=0
RejRowCount=0
Call DSLogInfo('Running Routine', RtnValidateLinks)
Call DSLogInfo('Using Param' : Arg1,RtnValidateLinks)
JobName=Field(Arg1,';',1)
StgLink_Name=Field(Arg1,';',2)
JobHandle=DSAttachJob(JobName , DSJ.ERRFATAL)
JobStatus=DSGetJobInfo(JobHandle , DSJ.JOBSTATUS)
JobStartTimestamp=DSGetJobInfo(JobHandle , DSJ.JOBSTARTTIMESTAMP)
JobEndTimestamp=JobStartTimestamp
If JobStatus=3
Then
JobRunStat='PENDING'
End
Else
JobRunStat='COMPLETE'
End
If JobStatus<>3
Then
InStg_Name=Field(StgLink_Name,',',1)
InLnk_Name=Field(StgLink_Name,',',2)
InRowCount=DSGetLinkInfo(JobHandle,InStg_Name,InLnk_Name,DSJ.LINKROWCOUNT)
Call DSLogInfo('Row Count On InputLink=':InRowCount,RtnValidateLinks)
OutStg_Name=Field(StgLink_Name,',',3)
OutLnk_Name=Field(StgLink_Name,',',4)
OutRowCount=DSGetLinkInfo(JobHandle,OutStg_Name,OutLnk_Name,DSJ.LINKROWCOUNT)
Call DSLogInfo('Row Count On OutPutLink=':OutRowCount,RtnValidateLinks)
JobEndTimestamp=DSGetStageInfo(JobHandle,OutStg_Name,DSJ.STAGEENDTIMESTAMP)
End
Command="db2 connect to ":DBName:" USER " :DBUser:" USING " :DBPassword
Call DSExecute("UNIX",Command,OsOutput,OsStatus)
If OsStatus<>0 then
GoTo ExitProc
End
SQLStatement1="insert into table values('":JobName:"','":JobStartTimestamp:"','":JobEndTimestamp:"','":JobRunStat:"',":INT(InRowCount):",":INT(OutRowCount):")"
SQLStatement2="commit"
Command1 = 'db2 -x ' : '"' : SQLStatement1 : '"'
Call DSExecute("UNIX",Command1,OsOutput1,OsStatus1)
Command2 = 'db2 -x ' : '"' : SQLStatement2 : '"'
Call DSExecute("UNIX",Command2,OsOutput2,OsStatus2)
ExitProc:
Ans=FLAG
arg1 value in '' or in "" its giving error
if i enter without single or double quotes its working.
But i must enter it through single or double quotes because routine activity must take this through single or double quotes. Please help its urgent.
thanks.