Hi,
i need to write a new routine that analyze the DataStage director log and write it in a table.
In the past i used a Job contol code that did it. The code was:
hJob = DSAttachJob("JOB1", DSJ.ERRFATAL)
STATO = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
EVENT_ID = DSGetNewestLogId(hJob,DSJ.LOGANY)-1
LOGSTRING = DSGetLogEntry(hJob,EVENT_ID)
TIME_STOP = CHANGE(Substrings(LOGSTRING,1,19)," ","_")
TIME_START = CHANGE(DSGetJobInfo(hJob, DSJ.JOBSTARTTIMESTAMP)," ","_")
ROW_WRITE = DSGetLinkInfo(hJob,"T_W","L_W",DSJ.LINKROWCOUNT)
ROW_ERR = DSGetLinkInfo(hJob,"T_W","L_ERR",DSJ.LINKROWCOUNT)
Now I have to use a Routin and I 'd like to use the same code but I have compilation errors:
Compiling: Source = 'DSU_BP/DSU.EBISLog', Object = 'DSU_BP.O/DSU.EBISLog'
***?
0039 ROW_WRITE = DSGetLinkInfo(hJob,"T_W","L_W",DSJ.LINKROWCOUNT)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
0040 ROW_ERR = DSGetLinkInfo(hJob,"T_W","L_ERR",DSJ.LINKROWCOUNT)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
0045 ROW_READ = DSGetLinkInfo(hJob,"T_R","L_R",DSJ.LINKROWCOUNT)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
0048 ROW_READ = DSGetLinkInfo(hJob,"T_W","L_R",DSJ.LINKROWCOUNT)
^
WARNING: Text found after final END statement
Array 'DSAttachJob' never dimensioned.
WARNING: Variable 'DSJ.ERRFATAL' never assigned a value.
Array 'DSGetJobInfo' never dimensioned.
WARNING: Variable 'DSJ.JOBSTATUS' never assigned a value.
Array 'DSGetNewestLogId' never dimensioned.
WARNING: Variable 'DSJ.LOGANY' never assigned a value.
Array 'DSGetLogEntry' never dimensioned.
WARNING: Variable 'DSJ.JOBSTARTTIMESTAMP' never assigned a value.
Array 'DSGetLinkInfo' never dimensioned.
WARNING: Variable 'DSJ.STAGELIST' never assigned a value.
8 Errors detected, No Object Code Produced.
I modified the code with the "Deffun" obtaining
Deffun DSAttachJob
Deffun DSGetLinkInfo
hJob = DSAttachJob(JOBID, DSJ.ERRFATAL)
STATO = DSGetJobInfo(hJob, DSJ.JOBSTATUS)
EVENT_ID = DSGetNewestLogId(hJob,DSJ.LOGANY)-1
LOGSTRING = DSGetLogEntry(hJob,EVENT_ID)
TIME_STOP = CHANGE(Substrings(LOGSTRING,1,19)," ","_")
TIME_START = CHANGE(DSGetJobInfo(hJob, DSJ.JOBSTARTTIMESTAMP)," ","_")
ROW_WRITE = DSGetLinkInfo(hJob,"T_W","L_W",DSJ.LINKROWCOUNT)
ROW_ERR = DSGetLinkInfo(hJob,"T_W","L_ERR",DSJ.LINKROWCOUNT)
StageList = DSGetJobInfo (hJob,DSJ.STAGELIST)
StageList=" ":CHANGE(StageList,","," , "):" "
and the copiling error now are:
Compiling: Source = 'DSU_BP/DSU.EBISLog', Object = 'DSU_BP.O/DSU.EBISLog'
***??
0036 hJob = DSAttachJob(JOBID, DSJ.ERRFATAL)
^
Incorrect number of arguments
0043 ROW_WRITE = DSGetLinkInfo(hJob,"T_W","L_W",DSJ.LINKROWCOUNT)
^
Incorrect number of arguments
0044 ROW_ERR = DSGetLinkInfo(hJob,"T_W","L_ERR",DSJ.LINKROWCOUNT)
^
Incorrect number of arguments
0049 ROW_READ = DSGetLinkInfo(hJob,"T_R","L_R",DSJ.LINKROWCOUNT)
^
Incorrect number of arguments
0052 ROW_READ = DSGetLinkInfo(hJob,"T_W","L_R",DSJ.LINKROWCOUNT)
^
WARNING: Text found after final END statement
Array 'DSGetJobInfo' never dimensioned.
WARNING: Variable 'DSJ.JOBSTATUS' never assigned a value.
Array 'DSGetNewestLogId' never dimensioned.
WARNING: Variable 'DSJ.LOGANY' never assigned a value.
Array 'DSGetLogEntry' never dimensioned.
WARNING: Variable 'DSJ.JOBSTARTTIMESTAMP' never assigned a value.
WARNING: Variable 'DSJ.STAGELIST' never assigned a value.
7 Errors detected, No Object Code Produced.
The questions are:
Is it possible to use the DSAttachJob or DSGetLinkInfo function in a Routine? How is it possible to do it?
Why do I obtain the "Variable 'DSJ.STAGELIST' never assigned a value." error?
Thanks in advance
Regards
Mario
write a Routine
Moderators: chulett, rschirm, roy
Hello eoyylo,
Please add to the beginning of your program and see what the compiler has to say; your compiler messages are due to the functions not being detected, and your DEFFUN don't have the correct number of parameters.
Please add
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>