Hi All,
I wrote a routine to get the misc info about the job.it is complied with no errors but when i try to test it it gives me the following error -
Line 17, Improper data type.
My routine code is -
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
JobHandle = DSAttachJob("Job1",DSJ.ERRFATAL)
JobStatus = DSGetJobInfo(JobHandle,DSJ.JOBSTATUS)
JobName = DSGetJobInfo(JobHandle,DSJ.JOBNAME)
JobStarted = DSGetJobInfo(JobHandle,DSJ.JOBSTARTTIMESTAMP)
JobEnded = DSGetJobInfo(JobHandle,DSJ.JOBLASTTIMESTAMP)
JobTimeElapsed = DSGetJobInfo(JobHandle,DSJ.JOBELAPSED)
FinalMsg = JobName : "," :JobStatus : "," :JobStarted : "," :JobEnded : "," :JobTimeElapsed
WRITESEQ FinalMsg To '/u04/test/FinalFile' THEN
END
ELSE STOP
Ans = "Success"
Your inputs are appreciated
Improper data type error in routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 74
- Joined: Thu Jan 05, 2006 2:07 am
Improper data type error in routine
Thanks,
Sourabh Verma
Sourabh Verma
Line 17 is your WRITESEQ statement. You cannot write "to" a file path, you need to open that file using OPENSEQ to a file unit and write "to" that unit.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you're uncomfortable with WRITESEQ and the BASIC family of sequential file handling statements, an alternative is to use an echo command.
Code: Select all
Shell = "UNIX"
Cmd = "echo " : FinalMsg : " >> /u04/test/FinalFile'"
Call DSExecute(Shell, Cmd, Output, ExitStatus)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 74
- Joined: Thu Jan 05, 2006 2:07 am
In the programming languages that I've used when doing sequential file I/O you always need to open the file prior to using it. Usually you open this file and assign the reference to this file to a variable and then use that variable in all future operations to read, write, reset or close the file. This "file pointer" or "file unit" or whatever you wish to call it is just a variable in DataStage (albeit a special type of value which cannot be displayed). In DataStage this file pointer can point to a simple sequential file when used with the OPENSEQ statement, or any one of the different hashed file structures (which also include a directory type).
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: