Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is it necessary to include the copybook to access a table

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

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Tue Feb 27, 2007 2:40 pm    Post subject: Is it necessary to include the copybook to access a table
Reply with quote

i have code a db2 cobol pgm in which i want to access one table named "POLICYTERM" and get some values

is it necessary to include its copybook
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Feb 27, 2007 2:45 pm    Post subject:
Reply with quote

Hi Paul,

It's not mandatory that you include copybook ( assuming its contain DCLGEN) in the program, but if you have, the Pre-complier validates the field name, etc and give you a warning at precompile stage .

Let me know if u need further explaination
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Tue Feb 27, 2007 3:57 pm    Post subject:
Reply with quote

^^ YES U R RIGHT I CREATED THE COPYBOOK USING dclgen

this means if i include copybook, it will inform me about wrong SQL statements which i have embedded in the cobol code
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Feb 27, 2007 4:01 pm    Post subject:
Reply with quote

yes
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Tue Feb 27, 2007 8:22 pm    Post subject:
Reply with quote

Hi,
i used following sql code in cobol pgm
EXEC SQL
SELECT DIVISION_ID
INTO :HOLD-DIV-ID
FROM GIPIF$01.POLICY
WHERE ZONE_ID = :HOLD-ZONE
AND POLICY = :HOLD-POLICY-NUMBER
AND SYMBOL = :HOLD-SYMBOL
AND MODULE = :HOLD-MODULE
AND MCO = :HOLD-MCO
END-EXEC
but the problem is that it is not fetching any value from table, i displayed the sqlcode and it is showing as 92P

could u pls throw some light
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 28, 2007 12:51 am    Post subject:
Reply with quote

Hello,

The 92P is most likely a -927 (P is the signed numeric for a negative 7).

If you search in this forum, you will see info on an SQL -927.
Quote:
THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED.
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Feb 28, 2007 10:59 am    Post subject:
Reply with quote

Quote:
Hello,

The 92P is most likely a -927 (P is the signed numeric for a negative 7).

If you search in this forum, you will see info on an SQL -927.
Quote:
THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED.

_________________
Hope this helps,


hi, thnx a lot, so the sqlcode which i am getting, is this bcos of fault from my side or system side
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Feb 28, 2007 12:50 pm    Post subject:
Reply with quote

Paul,
The sqlcode that u r getting can be both system side as well as user side it depends on situation , in order to get the sql code to a readable format move the sqlcode to a edited picture clause and then display the same .

Code:
77 sql-disp pic -9(3).
.
.
.
Move SQLCODE to sql-disp.
display sql-disp.


For -927 try to get the exact DSN name of your DB2 subsystem like DB2p or DB2D etc.. contact your manager for this.


Thamilzan.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Wed Feb 28, 2007 4:41 pm    Post subject: Re: Is it necessary to include the copybook to access a tabl
Reply with quote

Otherwise you can even move it to some packed decimal field and write in file to check it.
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Feb 28, 2007 6:41 pm    Post subject: Re: Is it necessary to include the copybook to access a tabl
Reply with quote

Quote:
Paul,
The sqlcode that u r getting can be both system side as well as user side it depends on situation , in order to get the sql code to a readable format move the sqlcode to a edited picture clause and then display the same .

Code:
77 sql-disp pic -9(3).
.
.
.
Move SQLCODE to sql-disp.
display sql-disp.


For -927 try to get the exact DSN name of your DB2 subsystem like DB2p or DB2D etc.. contact your manager for this.




thnx 4 help , i did wat u said and it is displaying the sql code correctly, idat wat u call "edited field ", correct me if i am wrong

and my DSN name is DSNP
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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us