Page 1 of 1

Packed Integer for Sequential File

Posted: Thu Sep 29, 2005 5:39 pm
by at095nb
My task is to extract data from DB (defined as Decimal (16,0)) and create a sequential file for mainframe. My target format is packed integer. I understand I need to do a conversion first. But how do I define packed integer in the file?

Posted: Thu Sep 29, 2005 8:00 pm
by rleishman
In the online help, search on OCONV. Go to the Conversion Codes link and look at the MP conversion code.

It could be as simple as

Code: Select all

Oconv(LK_in.my_integer, "MP")
You would probably need to set the output type to binary with a length of the number of bytes required.

In case you hadn't guessed, I've never tried it. Good luck though.

Posted: Fri Sep 30, 2005 7:23 am
by at095nb
That was exactly what I was doing in the first place. But the result looks like this
7B8B9472
7FFF234B
7FFFC373
7FFFE69B

It's not actual pack integer. It's a text representation of it.

Posted: Fri Sep 30, 2005 6:19 pm
by rleishman
Are you certain you set the output type to Binary?

Also, make sure you summarise everything you have already tried when you post a question. That way we don't waste our time and you don't have to go through the same solutions one-by-one again.