Comp-3 conversion problem

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
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Comp-3 conversion problem

Post 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
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post 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.
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Post by pkl »

Hi ChuckSmith,

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

Thanx for advance
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Post by pkl »

Can anyone please help me on this. It's urgent

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Post by pkl »

Hi,
I did both of them, still no luck.
I am doing:
DataTypePicComp3V99(DSLink3.InputColumn)

The result isn't right.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ogmios
Participant
Posts: 659
Joined: Tue Mar 11, 2003 3:40 pm

Post 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
In theory there's no difference between theory and practice. In practice there is.
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Post 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
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post 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.
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pkl
Participant
Posts: 50
Joined: Wed Aug 11, 2004 11:45 am

Post by pkl »

Hi,
Thanks all for your help. I'll install CFF and see if that helps.

Thanks once again
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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. :)
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
shawn_ramsey
Participant
Posts: 145
Joined: Fri May 02, 2003 9:59 am
Location: Seattle, Washington. USA

Post by shawn_ramsey »

chulett wrote:I don't see anywhere that the OP mentioned the FTP stage. :?
Sorry I assumed. :oops:
Shawn Ramsey

"It is a mistake to think you can solve any major problems just with potatoes."
-- Douglas Adams
Post Reply