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

Precompilation problem


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Oct 10, 2013 4:48 pm
Reply with quote

I am using below jcl to precompile cobol-DB2 code

Code:
//STP00#01 EXEC PGM=DSNHPC,PARM=('SOURCE','HOST(IBMCOB)', 
// 'APOST,APOSTSQL,')                                     
//STEPLIB  DD DSN=DPD2.BTLLOAD.PUSER,DISP=SHR             
//         DD DSN=DB2T.DSNEXIT,DISP=SHR                   
//DBRMLIB DD DSN=LFML.EXTW131.PAD.DBRM(MEM1),DISP=SHR     
//*                                                       
//SYSIN     DD DSN=LFML.EXTW131.PAD.TEST(COB222),DISP=SHR 
//SYSCIN    DD DSN=&&TEMP,                                 
//             DISP=(NEW,PASS),                           
//             SPACE=(TRK,(30,30),RLSE),                   
//             DCB=(RECFM=FB,LRECL=80)                     
//*                                                       
//SYSLIB    DD DISP=SHR,DSN=SYSU.SORTLIST.USER.COPYLIB     
//          DD DISP=SHR,DSN=SYSU.SORTLIST.MAST.COPYLIB     
//          DD DISP=SHR,DSN=PASA.UUIMST.PCOPY             
//          DD DISP=SHR,DSN=USRL.URPROD.PCOPY                   
//          DD DISP=SHR,DSN=SYSP.M01A.ADS901.OS390.VAKB.COBOL   
//*JE1008   DD DISP=SHR,DSN=SYSP.M01A.MEMO.API220.SOURCE         
//          DD DISP=SHR,DSN=SYSP.M06B.SSANAME3.SOURCE           
//*                                                             
//SYSPRINT DD SYSOUT=*                                           
//SYSTERM DD SYSOUT=*                                           
//SYSUDUMP DD SYSOUT=*                                           
//SYSUT1    DD SPACE=(23,(10,10),,,ROUND),UNIT=SYSDA             
//SYSUT2    DD SPACE=(23,(10,10),,,ROUND),UNIT=SYSDA


even though i have provided all the necessary libraries i am getting below error


Code:
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "EFTN-Table1"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "PAYN-Table1"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "STAT-Table1"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "SACN-Table1"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "PDAT-Table1"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "RAMT-Table1"


In SYSPRINT i can see that the above host varibles are included in my programe but its still showing above error.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Oct 10, 2013 4:53 pm
Reply with quote

Show us:
  • The definitions of these variables
  • The definitions of the columns to which they are intended to correspond
  • The statements in which the variables are used.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Oct 10, 2013 6:26 pm
Reply with quote

Table1 mentioned in above post is Y17PHIST.

Code:
   01  Y17PHIST.                       
  *    *********************************
       10 EFTN-Y17PHIST                 
           PIC X(10).                   
  *    *********************************
       10 PAYN-Y17PHIST                 
           PIC S9(7)V USAGE COMP-3.     
  *    *********************************
       10 STAT-Y17PHIST                 
           PIC X(10).                   


Code:
 DECLARE Y17CUR1 CURSOR WITH HOLD FOR     
  SELECT   EFTN,                           
           PAYN,                           
           STAT,                           
           SACN,                           
           PDAT,                           
           RAMT                           
     FROM Y17PHIST                         
     WHERE EFTN = :EFTN-Y17PHIST AND       
           PAYN = :PAYN-Y17PHIST AND       
           STAT = :STAT-Y17PHIST AND       
           SACN = :SACN-Y17PHIST AND       
           PDAT = :PDAT-Y17PHIST AND       
           RAMT = :RAMT-Y17PHIST           
        FOR UPDATE OF STAT                 
END-EXEC.                                 




Code:
  EXEC SQL                                       
       FETCH Y17CUR1  INTO  :EFTN-Y17PHIST,     
                            :PAYN-Y17PHIST,     
                            :STAT-Y17PHIST,     
                            :SACN-Y17PHIST,     
                            :PDAT-Y17PHIST,     
                            :RAMT-Y17PHIST       
  END-EXEC.                                     
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Oct 10, 2013 8:05 pm
Reply with quote

Are the fields in question in the LINKAGE-SECTION?

If yes, then that may be your issue. The Pre-Compiler does not like that.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Fri Oct 11, 2013 11:55 am
Reply with quote

No these fileds are defined in working storage section.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Fri Oct 11, 2013 12:57 pm
Reply with quote

Are they defined before your table and cursor declares? Used to be that that was a problem - presumably the pre-compiler is/was a one-pass effort.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Fri Oct 11, 2013 1:03 pm
Reply with quote

Quote:
pre-compiler is/was a one-pass effort

??

I have first included the table(which contain table defination and cobol equivalent structure) then declared the cursor.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Oct 11, 2013 4:09 pm
Reply with quote

try using option two pass.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri Oct 11, 2013 4:57 pm
Reply with quote

Why does your cursor use:

Code:
WHERE EFTN = :EFTN-Y17PHIST AND   


and your error say:

Code:
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "EFTN-Table1"


The names are different, and lower case?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Fri Oct 11, 2013 6:13 pm
Reply with quote

That was coppy-paste mistake error says

Code:
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "EFTN-Y17PHIST"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "PAYN-Y17PHIST"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "STAT-Y17PHIST"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "SACN-Y17PHIST"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "PDAT-Y17PHIST"
DSNH312I E UNDEFINED OR UNUSABLE HOST VARIABLE "RAMT-Y17PHIST"
Back to top
View user's profile Send private message
Joseph Reynolds

New User


Joined: 07 Oct 2013
Posts: 6
Location: United States

PostPosted: Sat Oct 12, 2013 10:22 am
Reply with quote

http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z10.doc.apsg/src/tpc/db2z_hostvariablecobol.htm

provides some reasons for the error. And lots of sentences starting with "You cannot ..."
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Sat Oct 12, 2013 9:21 pm
Reply with quote

Is there a DECLARE TABLE statement in the program? If so, please show it to us.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Oct 14, 2013 11:45 am
Reply with quote

there is only one declare statement in my programe(for cursor declaration) which i have mentioned in above post
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Oct 14, 2013 8:45 pm
Reply with quote

Is there a DCLGEN for the table?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Oct 14, 2013 10:08 pm
Reply with quote

yes there is DCLGEN for the table
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Oct 14, 2013 10:18 pm
Reply with quote

Did you compare the data types of your host variables with the data types of the columns in the table, as shown in the DECLARE TABLE portion of the DCLGEN?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Oct 15, 2013 1:17 pm
Reply with quote

Yes they are fine

Actually we have one tool in our account to do precompilation,bind etc.
When i precompile this programme using that tool it was sucessful, but when i tried without tool it is throwing this error.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Tue Oct 15, 2013 2:09 pm
Reply with quote

1) it is not THROWING an error. Things are not THROWN on the mainframe they are given, shown, displayed etc.

2) so your stuff works when using the shop standard stuff but not when you try something different. You have not shown us your code, you have not shown us the different JCLs and parameters used and you expect us to resolve something that your shop resolved a long time ago. Go and ask your colleagues why this difference. We do not work where you do (if we work at all) and we are not psychic.#

Hopefully someone will lock this and your duplicate post on another forum.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Oct 15, 2013 3:30 pm
Reply with quote

Nick please accept my sincere apologies.

Due to some problem we cannot use this tool to compile this programe hence i am trying to do it manually.I have already asked my colleagues but they are unable to solve this.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Tue Oct 15, 2013 3:39 pm
Reply with quote

So then begin by telling us -- as I asked you to do five days ago -- the definitions of the DB2 columns to which the variables are intended to correspond
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 z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top