Decimal to COMP3

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

goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Decimal to COMP3

Post by goriparthi »

Hi Guys,


I have a requirement to convert decimal values to comp3 and send them to mainframes, i browsed through and couldnt find the solution any where there are previous topics on this but nothing got resolved in them ,

Can anyone please help me if they have done the same thing earlier it would me very helpful to me.


Thanks
Raj
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Post by goriparthi »

Hi Guys,

Can anyone share their experience in this issue.



Thanks
Raj
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

If you just pass the decimal into comp-3 field in the mainframe table, what error does it give?
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

DECIMAL TO COMP3

Post by goriparthi »

Hi,

In my case i just need to give a feed to mainframes in a sequential file from our datawarehouse.So i need to convert this from a decimal to comp3 and give that value in a sequential file.


Thanks
Raj




Krazykoolrohit wrote:If you just pass the decimal into comp-3 field in the mainframe table, what error does it give?
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

can you post an example for the conversion? your decimal value and the corresponding COMP3 value you expect it to get.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Typical flat file interfaces don't put the onus of COMP-3 creation on the file creator. If I was in your shoes I'd push back on the requirement, insist on sending everything in 'display' format and put the burden of the COMP-3 conversion back on the target system where it is fairly trivial for them to do.
-craig

"You can never have too many knives" -- Logan Nine Fingers
clshore
Charter Member
Charter Member
Posts: 115
Joined: Tue Oct 21, 2003 11:45 am

Post by clshore »

I agree that you should push back.
But if you do have to create COMP-3, it's not really that bad (I've done it).

Let us know.

Carter
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

DECIMAL TO COMP3

Post by goriparthi »

Hi Carter,

Thanks a lot for your reply, Can you please help me out in this .I am desperatley looking for this solution,your response is highly appreciated.


Thanks
Raj.



clshore wrote:I agree that you should push back.
But if you do have to create COMP-3, it's not really that bad (I've done it).

Let us know.

Carter
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi

You may start with the DataTypePicComp3 routine in routine/sdk/data type.
It convert comp-3 to integer but it will be a start.
Hope This Helps
Regards
pnetti
Participant
Posts: 17
Joined: Fri Jan 07, 2005 7:28 am

Decimal to COMP3

Post by pnetti »

I have a requirement to create COMP3 fields in a DataStage Server job. The files need to be sent to the mainframe for processing.

Is there a way to create a COMP3 field in a server job, then transmit it to the mainframe? It sounds like its possible base on the dsxchange entry but I cant figure how its done.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

These decimal fields, are they signed. I mean, do you need to convert them to PicS9 or just comp3?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
Do you try to write in a CFF stage ?
I don't do it myself but maybe it will transfrom your data to the copybook format.
Last edited by thurmy34 on Wed Sep 03, 2008 1:40 am, edited 1 time in total.
Hope This Helps
Regards
pnetti
Participant
Posts: 17
Joined: Fri Jan 07, 2005 7:28 am

Decimal to COMP3 - CFF Test

Post by pnetti »

I tried this but the CFF stage does not support Stream Input links. It appears that is only accepts output links (reads data ).

Does anyone have any other suggestions, other than creating mainframe programs to pack data.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You can probably write a routine. But is it just comp3 or signed decimal (PicS9)?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pnetti
Participant
Posts: 17
Joined: Fri Jan 07, 2005 7:28 am

Decimal to COMP3

Post by pnetti »

I will need to convert several numeric data types. My target is the mainframe. I will be creating files using DataStage server for use on an IBM mainframe.

That means I would need the ability to conver numbers to:
PIC S9(9)V99.
PIC S9(9)V99 COMP3.

And others possibly.

In the end the file needs to be in EBCDIC so the ASCII to EBCDIC translation will need to happen on the DataStage server also.
Post Reply