Appending records to a seq file from BASIC

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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Appending records to a seq file from BASIC

Post by gpbarsky »

Hi.

I have two questions.

1) From a BASIC program, how can I do to append records to a sequential file ? The idea is to not override the existing records, and to write records at after the last record.

2) How can I invoke the "dsjob" program ? I put the dsjob invocation within a .bat file, but I got a message telling me that a "controller was not found". What is wrong ?

Thanks, and Have great days...
[8)]
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

1) Technically, you could loop thru and read all of the records to get yourself positioned at EOF or you could jump there by using SEEK. Its syntax is documented in the DataStage BASIC Guide.

2) I'm guessing it's not in your PATH. Either add it or try specifying the full path to the executable. Does it work outside of a batch file?

-craig
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

[:)] Thanks Craig for your answer. I will try with SEEK.

The thing with point (2) is that the program is found because it is prefixed with the whole path.

But when executing the command, something is not present at that moment.

By example, if I make a routine within DataStage that invokes by means of DSExecute command the .bat that I built, it works fine. No error messages are produced. But when I double click on the .bat of the server, it gives the "controller not found" message.

Do you know what's wrong ?

And thanks again.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"Controller not found" usually indicates that the job believes that it has been requested to run under control of another program (for example a job control routine), but that that other program cannot be found.
Try re-compiling the job, then invoking it from dsjob again.
Also verify that everything dsjob needs is being supplied in the BAT file.


Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply