Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Programs from HP3000 MPE Cobol to HP9000 UX Cobol

Status
Not open for further replies.

Pootytaint

Programmer
Jan 14, 2005
13
0
0
US
We are in the process of a huge conversion project and we keep finding little bugs on the MF-Cobol HP9000 side. For instance Reports are ok except the totals are off. It seems like an initialization problem, but I do not see anything obvious. I've been told MF Cobol is very strict in initialization, such as moving low-values to comp-3 fields. Does anyone have any ideas? A fellow programmer is doing a perform loop to move zeroes to individual comp fields in a huge table. We have 100 programs like this and do not want to do that much work.


 
Latent bugs due to lack of initialization in the MPE COBOL side could show up in the MF COBOL side. Certainly the INITIALIZE statement could be an easier fix than lots of "MOVE ZEROS". BTW, I don't think LOW-VALUES should be used with any numeric fields; better to MOVE ZEROS or INITIALIZE.

Regards.

Glenn
 
WRT LOW-VALUES:

LOW-VALUES is an alphanumeric literal which is not appropriate for a numeric (COMP-3) item.

Tom Morrison
 
You must understand your data structures thoroughly before you can do group-level moves to initialize numeric tables. Comp-3 is tricky. On most computers/compilers, it always has a sign nybble, which must be Ch, Dh, or Fh. On some, Ah, Bh, and Eh are permitted. On a few, 0 - 9 are permitted. On some computers/compilers, there is a sign nibble only if there is a sign in the picture.

As mentioned above, INITIALIZE is the standard COBOL verb to initialize tables and groups and to ensure the data fits the picture and usages.

Note also that LOW-VALUES is not always equal to 00h. On early implementations of Micro Focus COBOL, HIGH-VALUES was equal to 7Fh, not FFh.

If you have a table of Comp-3 fields all having the same picture, then a MOVE ALL X'00..000C' will work. For example:
Code:
 01  COMP-3-TABLE.
     05  COMP-3-ENTRY PIC S9(05) COMP-3 OCCURS 1000 TIMES.
   . . .
     MOVE ALL X'00000C' TO COMP-3-TABLE.
INITIALIZE COMP-3-TABLE will generally generate 1000 moves, internally. Not very efficient.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top