Page 1 of 1

Datastage Routines

Posted: Mon Feb 27, 2006 5:38 am
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?


Posted: Mon Feb 27, 2006 5:57 am
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.

Posted: Mon Feb 27, 2006 10:22 am
by ray.wurlod
Someone seems to have reinvented the echo "" > filename command! :roll: