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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cobol migration from Solaris to AIX

Status
Not open for further replies.

mkcobol

Technical User
Oct 21, 2010
4
0
0
PE
Hi, I'm new in this forum. What I want is to ask a help from your experience. We're migrating a Microfocus Server from Sun to AIX. The program is running without problem in Sun, but when I compile and then run in AIX some fields displays differents. For example:
In the WORKING-STORAGE I have:
05 Field1 PIC S9(7) COMP.

then, I make a DISPLAY:
DISPLAY "Field1: " Field1.

RESULT
Field1: +0005530814

My servers:
OLD SERVER: SUN SOLARIS
OS : Solaris 10
DataBase ORACLE 9i
Microfocus Cobol : Server Express 4.0.00 - Copyright (C) 1985-2004 Micro Focus International Ltd.
Compile option : -C IBMCOMP

Server NEW: IBM Power 7
OS : AIX 6.1
Database : ORACLE 10g
Microfocus Cobol : Server Express 5.1.00 - Copyright (C) 1985-2008 Micro Focus (IP) Limited
Compile option : -C IBMCOMP

Thanks for your help.

Beto.
 
From the Sun Server displays

Field1: +5530814

From the AIX Server displays

Field1: +0005530814

Regards,

Manuel
 
Is this a problem?

Suggest you modify the code to WRITE this value into a file and then look at the 2 files and see if they are the same or are different.
 
I've done this. It looks like I showed the post before. Is there any compilation directive I have to consider when I migrate the server?
 
I'm confused. . .

0005530814 will not fit into a field defined as:
05 Field1 PIC S9(7) COMP.

I didn't mean to route the output of the display to a file. I meant to actually WRITE into the file and look at the content.
 
Do you mean the source code? It's the same in both cases.

Could be possible to affect the change of the OS and the version of Database System and the Cobol compilator?
 
He means, I think, that instead of coding:
Code:
DISPLAY display-string
change your program to do
Code:
WRITE filename FROM display-string
Then look at the file.


Nic
 
With IBMCOMP, an S9(7) COMP field takes up 4 bytes, with a theoretical maximum value of 4,294.967,295, the same as an S9(9) COMP field. COBOL rules limit the maximum value to the size of the PICture.

With the DISPLAY statement, the COBOL rules are somewhat more vague. It seems that the Micro Focus compiler for the Sun computer limits the display to the length of the PICture. However, IBM's compilers have always displayed the number of digits the field would have if the PICture were the maximim allowed by the resulting field. Appearantly, Micro Focus has chosen to more closely emulate the IBM compiler.

In either case, the actual field should be 4 bytes, with IBMCOMP.
 
My bad. . . .

I read the field as comp-3 rather than comp. . .

Bummer.

@Nic
Yup, that is what i meant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top