Re: AIX COBOL set 1.1 using UDB - help on compilation

From: Robert Jones (rjones0_at_hotmail.com)
Date: 08/29/04


Date: 28 Aug 2004 18:17:56 -0700

Bottom posting

"kprasann" <ashprav@rediffmail.com> wrote in message news:<ebb4d6a7a9ecc6e4b312c4d8858819ef@localhost.talkaboutprogramming.com>...
> Hello everybody,
>
> we are trying to port mainframe(z/OS) cobol applications
> to AIX cobol set 1.1 with UDB as the database in AIX.
> While compiling cobol programs accessing db2 udb, I'm
> getting errors on usage of host variables.
> It's like this:
>
> Working-storage section.
> 01 ws-variable.
> COPY copybook.
>
> The copybook has a host variable. precompiler says, it's undefined.
> Now, when I try to enclose the "COPY copybook" within "exec sql begin
> declare section end-exec" and "exec sql end declare section end-exec",
> pre-compiler won't recognise "COPY" keyword. I'm not even very sure on
> this is the way I'm supposed to handle...got this information reading some
> manuals.
>
> I'm not sure how to handle this without changing the copybook or
> INCLUDE-ing it since the copybook is under a 01 level(which is in the
> program).
>
> Me being new to AIX COBOL and all the AIX related stuff, please guide me
> to a solution....thanks much! if possible, please e-mail or attach any
> references to my id : ashprav@rediffmail.com. thanks again :)

Hello Kprasann

I guess that the problem is probably that your mainframe compiler
includes the DB2 precompiler in with the cobol compiler and does the
whole process at once, whereas the precompiler in AIX is in a separate
step before your cobol compile step. If so you will have to change
the COPY to a DB2 INCLUDE so that the precompiler can expand it
itself. It's some time since I last used DB2 and I always used a
precompiler even on a mainframe, so all copybooks containing host
variables had to be invoked with INCLUDE statements. Host variables
always used to have to be within a EXEC SQL / END-EXEC, but that may
no longer be the case. Your manuals should explain this, particularly
the programmer's guide for COBOL and or DB2 on AIX. If you haven't
got the manuals, you can get them from IBM's website, they're free for
anyone to download when I last looked, but you may have to register,
which again was free for anyone last time I looked.

Best of luck,

Robert



Relevant Pages

  • Re: AIX COBOL ASSIGN error.
    ... I don't think you have told us if you are an experienced COBOL programmer who ... new to AIX - or if you are new to COBOL and AIX. ... Message routine called from offset 0x38 of routine ...
    (comp.lang.cobol)
  • Re: AIX COBOL ASSIGN error.
    ... I don't think you have told us if you are an experienced COBOL programmer who is ... new to AIX - or if you are new to COBOL and AIX. ... Message routine called from offset 0x38 of routine ...
    (comp.lang.cobol)
  • Re: AIX ASSIGN problems
    ... >We're trying to compile and run our first COBOL programs on AIX (we've ... It would help if you told us which COBOL brand and version you are ... >We verify the environmental variables are accurately set up by executing ...
    (comp.lang.cobol)
  • Re: Cobol set for AIX - secuential files - DDMEA
    ... > I have a problem with Cobol and secuential files when migrating from ... > MVS to AIX. ... > original .ddmea file with the name of sorted file and all work fine ...
    (comp.lang.cobol)
  • Re: Crazy COBOL system, need help with cob2csv
    ... contain a section of the code that appears to be the copybook, ... Cob2csv is written in MicroFocus Cobol but should be easily converted ... more recent MF compiler, cob2csv I posted here some months ago will do ... Output data file: cob2csv.out ...
    (comp.lang.cobol)