You can write a Server Job that is just a BASIC program that reads a binary file and spits out a text file that DataStage can then read with a Sequential File component. The Server Job canvas is blank, and can't hold any other components.
What I would like is a "BASIC Code" component that contains the code to read a custom file format, but which outputs on a link. The component would hold the output format, which would generate something like an array structure that the BASIC code could write to, with a "send" command to send the completed structure to the output link.
Maybe a matching pair, "BASIC Reader" and "BASIC Writer" would be good.
Integrate BASIC file reading with other component
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard! :D
Can you be a bit more detailed with your specification?
The easy solution would be to construct a shared container containing a Sequential File stage and an output link. The Sequential File stage can specify a Filter command; this could (perhaps) achieve your binary-to-text conversion.
Why does it have to be BASIC?
Can you be a bit more detailed with your specification?
The easy solution would be to construct a shared container containing a Sequential File stage and an output link. The Sequential File stage can specify a Filter command; this could (perhaps) achieve your binary-to-text conversion.
Why does it have to be BASIC?
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.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
It doesn't, I'd rather write it in Perl!ray.wurlod wrote:Why does it have to be BASIC?
I am suggesting an enhancement (or replacement for) the existing facility to write a Server Job that is entirely implemented in BASIC. The Sequential File component does not appear to be capable of processing a file that does not have line terminators, the only way to process these files is to make a Server Job that reads the file and writes to an output file. What I believe would be a more useful method would be to read the file using BASIC and output it to a link.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The project on which I'm currently working uses solely unterminated text files. The line terminator property is on the Stage tab in the Sequential File stage.
Its only requirement is (obviously) that the records are in fixed width format. It's OK that there are multiple record formats (as we have here) but they must all contain the same number of characters. And the total of the display widths in the Columns metadata on the Output link must be the same as this record length. (This is what Craig was alluding to.)
Its only requirement is (obviously) that the records are in fixed width format. It's OK that there are multiple record formats (as we have here) but they must all contain the same number of characters. And the total of the display widths in the Columns metadata on the Output link must be the same as this record length. (This is what Craig was alluding to.)
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.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
So have you ever needed to write a "Job Control" procedure that opens a file via a filehandle and writes out to another handle? Can you think of a file type of file that would need this?chulett wrote:Sure it can. Set 'Terminators' to 'None' and then ensure your Display metadata is correctly sized.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes, I've done this, but without writing any code, using Sequential File stages in some cases, and using an after job subroutine (ExecSH) to execute a UNIX mv command in other cases (move file once processed).
If you're needing to interact with some other application, you may find the capacity of the Sequential File stage to use named pipes useful.
If you really believe you need to code this please reconsider. If you still want to do it in code, check the BASIC manual for the statements OpenSeq, ReadBlk, WeofSeq, WriteBlk and CloseSeq.
If you're needing to interact with some other application, you may find the capacity of the Sequential File stage to use named pipes useful.
If you really believe you need to code this please reconsider. If you still want to do it in code, check the BASIC manual for the statements OpenSeq, ReadBlk, WeofSeq, WriteBlk and CloseSeq.
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.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
No, I'd really rather not! I was told on the course that the Sequential File stage couldn't handle fixed-length binary records, and we did an exercise that read a fixed-length file using file handles. This suggestion is an improvement for that process, but if you're saying it's unnecessary, then that's great!ray.wurlod wrote:If you really believe you need to code this please reconsider.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
Phil,
I believe that anytime you feel that something would be useful from a developer standpoint then you should pursue the idea. There is a place on the Ascential eServices site to enter enhancement requests. These requests get prioritized and you never know.... one day they may make it into the toolset. Much of the functionality within the current toolset comes from just these types of ideas.
What's the worst thing Ascential can say.... no and then you're back to where you were, but you tried.
Regards,
I believe that anytime you feel that something would be useful from a developer standpoint then you should pursue the idea. There is a place on the Ascential eServices site to enter enhancement requests. These requests get prioritized and you never know.... one day they may make it into the toolset. Much of the functionality within the current toolset comes from just these types of ideas.
What's the worst thing Ascential can say.... no and then you're back to where you were, but you tried.
Regards,
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com