Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem in including a DCLGEN copybook

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Nisha sam

New User


Joined: 18 Jan 2008
Posts: 11
Location: India

PostPosted: Thu May 29, 2008 3:44 pm    Post subject: Problem in including a DCLGEN copybook
Reply with quote

Hi,
I am using a DCLGEN copybook(U30) in my Cobol-DB2 program. The copybook.The copybook has SQL variables followed by COBOL variables like the following structure

EXEC SQL DECLARE DB10G01.U30 TABLE
( STATE CHAR(2) NOT NULL,
FIELD_ID CHAR(4) NOT NULL
) END-EXEC.
01 :TAG:.
STATE
10 :TAG:-STATE PIC X(2).
FIELD_ID
10 :TAG:-FIELD-ID PIC X(4).


and i have included it in program as
EXEC SQL
INCLUDE U30
END-EXEC.

Now my question is how to give an replacement for the :TAG: in the copybook. It is giving an compilation error.
Please give me your suggestion.
Back to top
View user's profile Send private message

vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu May 29, 2008 3:59 pm    Post subject:
Reply with quote

Hi,


Quote:
01 :TAG:.
STATE
10 :TAG:-STATE PIC X(2).
FIELD_ID
10 :TAG:-FIELD-ID PIC X(4).


wat you coded is correct?? but, wat about above variables??

Sen your source listing too.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Thu May 29, 2008 4:01 pm    Post subject:
Reply with quote

1. somebody got too slick. there is not 'replace' parm for include pre-compiler command.

2. changeing the name of host variables contained in the dclgen copybook is subject to better thought. why do it? makes trying to search thru modules that affect db2 columns would become impossible.


if you are using cobol3, change the include to copy, use the replace function of copy and insure that the compiler is set up to do the internal db2 prepass.

If you are not using cobol3, then you are stuck with a bad implementation and you need to have the dclgen changed.
Back to top
View user's profile Send private message
Nisha sam

New User


Joined: 18 Jan 2008
Posts: 11
Location: India

PostPosted: Thu May 29, 2008 4:11 pm    Post subject: Reply to: Problem in including a DCLGEN copybook
Reply with quote

Hi Vasanth,
The copybook expansion is as given in bold in my previous post. The variables with :TAG: are the cobol equivalent variables of the table.
The following is the source listing for the copybook expansion.

*#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
* EXEC SQL INCLUDE U30
* 1 U30 01.01 2008/05/06 2008/05/06 14:09 327 32
*#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=
*********************************************************
* DCLGEN TABLE(U30)
*********************************************************
*****EXEC SQL DECLARE U30 TABLE
*****( UCM_CO CHAR(6) NOT NULL,
***** STATE_ABBR CHAR(2) NOT NULL,

*****) END-EXEC.
*********************************************************
* COBOL DECLARATION FOR TABLE U30
*********************************************************
01 :TAG:.

IGYDS0009-E ":" should not begin in area "A". It was processed as if found in "B".

IGYDS1089-S "01" was invalid. Scanning was resumed at the next area A item,level-number, or the start of the next clause.
Back to top
View user's profile Send private message
Nisha sam

New User


Joined: 18 Jan 2008
Posts: 11
Location: India

PostPosted: Thu May 29, 2008 4:15 pm    Post subject: Reply to: Problem in including a DCLGEN copybook
Reply with quote

Hi Dick,

Thanks for the input.
I am using COBOL2. Since it is a client provided copybook I wanted to check out if there's any option to replace :TAG: before needing to change the copybook itself.
And it seems like there isn't.
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 276
Location: Bang,iflex

PostPosted: Thu May 29, 2008 4:20 pm    Post subject:
Reply with quote

Hi,



All the EXEC SQL statement should start at area B, and colon(icon_smile.gif in the cobol equivalent variable is invalid for ex:
Quote:
10 :TAG:-STATE PIC X(2).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Thu May 29, 2008 5:07 pm    Post subject:
Reply with quote

How does your client accomplish this? are all of his dclgen's done this way?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us