Page 1 of 1

Comp-3 conversion problem

Posted: Mon Dec 06, 2004 5:08 pm
by pkl
Hi,

I want to convert a pic s9(9)v99 Comp-3 field

I am FTP ing the file from mainframes.

I searched the forum for any possible ideas but didn't help me much.

Can anyone throw some light on this conversion issue.

Thanx

Posted: Mon Dec 06, 2004 5:51 pm
by chucksmith
ftp the file in binary mode to create a sequential file on your DataStage server, then use the CFF (complex flat file) stage to read the file.

Posted: Mon Dec 06, 2004 9:34 pm
by pkl
Hi ChuckSmith,

Thanx for the reply. I do not have CFF installed. Is there any other way?

Thanx for advance

Posted: Tue Dec 07, 2004 10:25 am
by pkl
Can anyone please help me on this. It's urgent

Thanks

Posted: Tue Dec 07, 2004 10:50 am
by chulett
If you have access to Ascential Support, they'd be your best bet for "urgent" issues.

Try defining your input field as a CHAR(6) and then using the DataTypePicComp3 sdk routine.

Posted: Tue Dec 07, 2004 10:51 am
by crouse
PKL,

Chuck Smith indicates the best way to do the conversion, uning the CFF stage.

Short of that, try the routine "DataTypePicComp3" in the SDK category.

Make sure the FTP from the mainframe was in binary mode to begin with, or the COMP-3 data will not be usable.

-Craig

Posted: Tue Dec 07, 2004 11:11 am
by pkl
Hi,
I did both of them, still no luck.
I am doing:
DataTypePicComp3V99(DSLink3.InputColumn)

The result isn't right.

Thanks

Posted: Tue Dec 07, 2004 11:15 am
by chulett
How is it defined in your input file? Are you sure that a binary ftp was used to bring the data to your server? You also can't do any kind of automatic EBCDIC to ASCII conversions during the FTP process as it destroys packed fields.

Posted: Tue Dec 07, 2004 11:17 am
by ogmios
A quick check, ftp the file back to the mainframe as see whether you still have the 'original data' in the file.

I stopped doing EBCDIC conversions in DataStage a long time ago. My experience is that unpacking/conversion/stripping of high- and low characters is much easier to code on the mainframe.

Ogmios

Posted: Tue Dec 07, 2004 11:21 am
by pkl
Hi Craig,

While doing the ftp I specified it to be in binary representation. I thought that should be enough. Is there anythign else I need to check for?

Thanks

Posted: Tue Dec 07, 2004 11:38 am
by shawn_ramsey
pkl wrote:Hi Craig,

While doing the ftp I specified it to be in binary representation. I thought that should be enough. Is there anythign else I need to check for?

Thanks
Are you really stuck on using the FTP stage? If not I would just set a script up to binary ftp the files to the DataStage server then use the complex flat file stage to convert the data. We are doing this for files that we get from the AS/400 and it works great and it sure beats having to do all the conversions in the transformer.

Posted: Tue Dec 07, 2004 11:46 am
by chulett
I don't see anywhere that the OP mentioned the FTP stage. :?

As noted, the best answer is to do a binary FTP and then let the CFF stage do all of the dirty work. If you don't have it installed, why not take the time to do so? Rerun the server install and it should let you simply install any optional plugins you missed the first time.

Posted: Tue Dec 07, 2004 11:48 am
by pkl
Hi,
Thanks all for your help. I'll install CFF and see if that helps.

Thanks once again

Posted: Tue Dec 07, 2004 1:09 pm
by crouse
PKL,

If you are trying to convert the file from the mainframe "by hand" you've probably run into a very nasty problem, because I did several times before the CFF stage was available from Ascential.

If you have several packed fields (COMP-3, COMP, etc) mingled with non-packed fields (PIC X, PIC 9, etc) in your data, you're doomed to fail if you don't understand HOW the data is packed. Packed means packed. A 12 digit numeric field that is packed does not take up 12 bytes. It may take up 6 or 7 depending on HOW it is packed.

If you mess up this calculation of offset, EVERY OTHER OFFSET OF FIELDS IN THE ROW IS MESSED UP, and you'll never convert the data correctly.

Unless you're intimately familiar with EBCDIC and packed data and packing algorithms, use the CFF stage.

Otherwise, buckle up and get ready to spend a lot of time getting lost in the data. While you're at it, dust off you're resume. :)

Posted: Tue Dec 07, 2004 2:10 pm
by shawn_ramsey
chulett wrote:I don't see anywhere that the OP mentioned the FTP stage. :?
Sorry I assumed. :oops: