Datastage Routines

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Madhu1981
Participant
Posts: 69
Joined: Wed Feb 22, 2006 7:49 am

Datastage Routines

Post by Madhu1981 »

OpenSeq <FileName> To objFileVar
Else
Create objFileVar
Else
ErrorCode = 1
WeofSeq objFileVar
End
End
WeofSeq objFileVar
CloseSeq objFileVar

I found the above lines in one routine and i didn't understand the 100% functionality.

Could any one explain me about the code in detail to me? Like the functionality of"Create objfilevar", weofseq objFileVar ....

In Pdf, i didn't find the the value "1" for error code. ErrorCode =1 means what?

Can any one helps me?

ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You should open up the BASIC pdf handbook to get the description of the functions used. They are OPENSEQ, CREATE, WEOFSEQ and CLOSESEQ. The code as you pasted will not compile, for example the compiler won't accept "<FileName>", perhaps you made that change before posting it here?

Basically, the code will open up a sequential file called <FileName>. If the file doesn't exist it will create a 0-length filesystem object. If the file is already there, it will be truncated to 0-length.

There is no single definition for ErrorCode; but if you are using this code in a Before/After subroutine an ErrorCode of 0 means that everything went without errors, a value that is not zero denotes an error occurred.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Someone seems to have reinvented the echo "" > filename command! :roll:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply