× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On Nov 8, 2008, at 4:03 PM, Aaron Bartell wrote:

So I am doing a project where I am reading a record that has a single
column with a whole bunch of data. The need is to read the record and
then place a data structure over it after I learn what type of record
it is by reading the first character in the column. That's all fine
and dandy but the documentation I received that describes the data is
COBOL data structures. I have found a comparison chart of RPG to
COBOL for data types, but I would like input to see if I actually have
the conversion correct. Are the below corresponding fields right?
And if not could somebody pitty this poor COBOL dimwit and give me the
right definitions? :-)

COBOL
03 FLD1 PIC 9V9(8).
03 FLD2 PIC 9(8)V9(10)
03 FLD3 PIC S9(15)V999


You need to make the first two values here unsigned at the very least.

But it depends upon where this data is coming from. If it's from a 400, then the unsigned data
will be packed decimal (P) not zoned decimal (S). If it is from somewhere else, it is likely to be
binary (B).

Double check the import source and make sure there are no USAGE IS clauses on it.

USAGE COMP will be packed
USAGE IS DISPLAY will be binary or ascii, depending upon where the heck it comes from.

Watch out for packing and alignment issues too.

-Paul


RPG
D FLD1 S 9S 8
D FLD2 S 18S 10
D FLD3 S 18S 3


Thanks,
Aaron Bartell
http://mowyourlawn.com
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.