Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.