View previous topic :: View next topic
|
Author |
Message |
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
No these fileds are defined in working storage section. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
try using option two pass. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
Joseph Reynolds
New User
Joined: 07 Oct 2013 Posts: 6 Location: United States
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Is there a DECLARE TABLE statement in the program? If so, please show it to us. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
there is only one declare statement in my programe(for cursor declaration) which i have mentioned in above post |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Is there a DCLGEN for the table? |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
yes there is DCLGEN for the table |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
|