Operating System - Linux
1753831 Members
8961 Online
108806 Solutions
New Discussion юеВ

Re: error in cobol compilation

 
Allan Campbell
Advisor

error in cobol compilation

Both of my servers are running HPUX 11.11 with identical current patches. When the following command is run, the older system compiles OK, the new system gets the error you see below: "/opt/cobol/cobdir/bin/cob -x -o ~/temp/repbuild repbuild.o"
response:
"as: unrecognized option `-41'
/opt/mfcobol/cobdir/bin/cob: error(s) in assembling /var/tmp/cobBAAa13298/%cob0.s"
These are running Cobol41 with these bundles - B2430EB, B2432EB, B2433EB, and B2435.
18 REPLIES 18
A. Clay Stephenson
Acclaimed Contributor

Re: error in cobol compilation

The very first thing that I would compare is the environment. Do an env as the same user on both boxes and compare them. Pay special attention to COBDIR.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: error in cobol compilation

2nd whackball thought: Are both of these boxes running the same "bitness" of the operating system?
If it ain't broke, I can fix that.
Allan Campbell
Advisor

Re: error in cobol compilation

Already checked. env is the same. I do notice a difference in the file directories located in /opt/cobol/bin. Even though the cobol installed is the same. The newer install has more directories. The dates appear to be the same on the ones that are there. Also /opt/cobol/bin/cobol appears to be the same on both.
Allan Campbell
Advisor

Re: error in cobol compilation

older is N4000. newer is rp3410.
A. Clay Stephenson
Acclaimed Contributor

Re: error in cobol compilation

Is the current user's home directory writable? I would also try invoking the command without the tidle and instead using the absolute path for the -o (output) file. I assume that the .o object file was actually created on this machine.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: error in cobol compilation

It's been a long time (thankfully) since I've had to do any COBOL work but one other thing that I found in my notes: compare the contents of ${COBDIR}/cobopts on the good and bad boxes. All this command should be doing is passing the repbuild.o to the linker (ld) for linking to create the executable so the reference to a .S (assembly source) .S is a bit strange. If this is a makefile then use -n to show the exact commands that would be executed. If this is not a makefile then it appears that you are omitting a critical piece of the puzzle.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: error in cobol compilation

Which as(1) are you running? Do you have the gnu as(1) installed or in your PATH on one and not the other?

HP's as(1) gives these messages:
$ as -41 #PA
as: warning 2: Unknown option "-41" ignored.
$ as -41 #IPF
error 2005: invalid option '-41'

The foreign devil as(1) gives:
$ /usr/local/bin/as -41
/usr/local/bin/as: unrecognized option `-41'

Of course in both cases it doesn't like the -41. Is there a way to get a verbose output from cob, -v?
A. Clay Stephenson
Acclaimed Contributor

Re: error in cobol compilation

I actually think the -41 is an artifact of the COBOL Version 41 and that is being passed possibly because the compiler is being asked to output the version as if cob -V were invoked.
If it ain't broke, I can fix that.
Allan Campbell
Advisor

Re: error in cobol compilation

I had the user create a new .o file - same problem. Then (as root) I ran the following command "/opt/cobol/cobdir/bin/cob -x -v -o /tmp/cobtest". This created /tmp/cobtest on the old server, but error was
"/opt/cobol/cobdir/bin/cob -V nolist -x -v -o /tmp/cobtest
as: unrecognized option `-41'
/opt/mfcobol/cobdir/bin/cob: error(s) in assembling /var/tmp/cobBAAa26968/ldtaab.s"
The -V nolist line was the first part of the returned message on both servers.