Page 2 of 2

Posted: Thu Jan 25, 2007 11:43 am
by DSguru2B
You can study the source code for routines like "DataTypePicS9" and do the inverse and create your own routine to achieve the same.

COMP-3

Posted: Wed Jan 31, 2007 12:55 pm
by pnetti
I have to admit that I have not had much success with reversing this code. The original code hardly makes sense.

I am now using iconv with an MP coversion code to pack a number. I ftp the file to the mainframe as binary with no conversion to ebcdic.

Negative whole numbers are sucessful, but I can't pack positive numbers or decimals. Positive numbers do not include the sign bit.

Does any have any thoughts on this one??

Re: COMP-3

Posted: Wed Jan 31, 2007 3:20 pm
by ray.wurlod
pnetti wrote:The original code hardly makes sense.
Is that because of your unfamiliarity with the language, or do you really have a problem with the logic?

The Iconv() and Oconv() functions are perilous ground for newbies, particularly the ones that handle binary data.

COMP 3

Posted: Thu Feb 01, 2007 11:49 am
by pnetti
I am not that familiar with the language.

When I review the code of the existing routines, it doesnt seem like I can just reverse the logic.

For example, the current routines do not handle the implied decimal. The packed number is converted as a whole number then divided by a number to move the decimal point.

I dont think this approach will work in the reverse order. But as I said, I am not really that strong with the basic language.

(Not only do I need to convert to comp-3, I have to convert to signed comp fields.)