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 about precompile step

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

New User


Joined: 16 Jan 2006
Posts: 9

PostPosted: Wed Mar 15, 2006 3:20 pm    Post subject: Problem about precompile step
Reply with quote

Hello,

I have a question regarding Cobol and DB2. I tried to compile a program and i got an error message 'undefined or unusable host variables : T001VP'. I found that the variable was defined in a copybook. I renamed variable from T001VP to XXXXXX both in program and copybook, then had it recompile. I still got the same error and so strange that the error is the same 'undefined or unusable host variables : T001VP'.

I don't know why it still use the old variable name instead of using the new variable name.

Best regards,
Siriporn P.
Back to top
View user's profile Send private message

guptae

Moderator


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

PostPosted: Wed Mar 15, 2006 3:31 pm    Post subject:
Reply with quote

In spool its also give you the line number.
Plz check that particular line & let us know whether it contain that variable
Back to top
View user's profile Send private message
Siriporn P.

New User


Joined: 16 Jan 2006
Posts: 9

PostPosted: Wed Mar 15, 2006 3:44 pm    Post subject:
Reply with quote

How can i see spool? Sorry to ask the stupid question, i am a newer in DB2.
Back to top
View user's profile Send private message
Brian's_song

New User


Joined: 27 Dec 2005
Posts: 21

PostPosted: Sat Mar 18, 2006 5:57 pm    Post subject:
Reply with quote

hi my friend,

I used to see that the variable which had been renamed could not be quoted any more in the program, So I guess you have used the variable iT001VP' in your program. If yes, I advise you to redefine the T001VP' instead of Rename it.

Correct me if wrong.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1244
Location: Israel

PostPosted: Mon Mar 20, 2006 3:01 pm    Post subject:
Reply with quote

I don't know why it showed the same name after you changed. The reason for the message is that:
the variable is used by the DB2 precompiler (step 1), but it will appear only in the compiler (step 2), because this is where the COPY statements are processed.

You can use EXEC SQL INCLUDE copyname END-EXEC instead of COPY copyname.

Or you can define a var in WS and make a MOVE into it before using it in your DB2 statements.
Back to top
View user's profile Send private message
KS

New User


Joined: 28 Feb 2006
Posts: 91
Location: Chennai

PostPosted: Mon Mar 20, 2006 3:38 pm    Post subject:
Reply with quote

Hi,

U just need to include the DCLGEN for that varaible in the program using EXEC SQL
INCLUDE (NAME)
End EXEC.

I dont think u need to redefine or rename.
Kindly correct if wrong.

Thanks,
KS
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Mon Mar 20, 2006 3:47 pm    Post subject:
Reply with quote

hy,

you must know,
that the db2 precompiler will check all variables used
in any sql statement. if the variable declaration is in a cobol
copybook, you have to translate the copybooks first.
you can do this, when giving the appropriate cobol
options, only to make a source translation no object code.

note: with the new compiler family of cobol (i.e. enterprise cobol...)
you are able to avoid this by using the integrated db2 coprocessor
which will be running also while compiling the program,
therefore you only one step for compilation, no translator step.

the post with sql include is right, just use a dclgen version of your
copybook...

martin9
Back to top
View user's profile Send private message
sunil_chappy

New User


Joined: 19 Mar 2006
Posts: 9
Location: Bangalore, INDIA

PostPosted: Wed Mar 22, 2006 2:37 am    Post subject: Re: Problem about precompile step
Reply with quote

U can see the particular line in spool which is giving error.

Use in Ist step PARM=Offset,Source(COB2)
In spool are u will get the address of every line and u can find easily that partcular line.

Correct me if i worng.

Sunil
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm

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