IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in including a DCLGEN copybook


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 275
Location: Bang,iflex

PostPosted: Thu May 29, 2008 3:59 pm
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: 6966
Location: porcelain throne

PostPosted: Thu May 29, 2008 4:01 pm
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
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
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: 275
Location: Bang,iflex

PostPosted: Thu May 29, 2008 4:20 pm
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: 6966
Location: porcelain throne

PostPosted: Thu May 29, 2008 5:07 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Trying to change copybook in online c... CICS 4
No new posts Help to Filter File Manager Copybook ... DFSORT/ICETOOL 14
No new posts z/vm installation problem All Other Mainframe Topics 0
Search our Forums:

Back to Top