View previous topic :: View next topic
|
Author |
Message |
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi All,
Can we use FD variables as Host variable in Cobol-Db2 programs.
Example:
I have an input file and I need to search Db2 table using contents of this file.
So can I use the FD variables of this file directly as Host variables in WHERE clause or I need to move them explicitly in Host variables before using them
Thanks and regards,
Chandan |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Can we use FD variables as Host variable |
No wonder people have problems!
They don't understand the basics.
What in the world is a FD variable?
If you mean fields of the records, yes you can,
but experienced people use work area option
and do not directly address the buffers. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
..
Quote: |
If you mean fields of the records, yes you can |
I believe no other option is left for OP... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
I believe no other option is left for OP... |
other than learn correct terminology,
which would help in his/her search for answers.
y'all can stay dummed-down, but I refuse to let rookies alter my vocabulary. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Yeah, agree Dick. |
|
Back to top |
|
|
Keith Cheetham
New User
Joined: 10 Jan 2012 Posts: 1 Location: USA
|
|
|
|
As my recent experience has proven, no you cannot. As suggested above, do not use the 01 record definition in the FILE-SECTION even though it contains the data. Do a READ INTO some definition in WORKING-STORAGE |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as both Keith has said,
and another recent thread (2-3 months)
do not use fields that reside in the FD Section as host variables for db2.
what I stated earlier is false |
|
Back to top |
|
|
lindovaldolpn
New User
Joined: 25 Feb 2010 Posts: 16 Location: Brazil
|
|
|
|
Depends on ...
I have worked with migration code. For example (from CSP to COBOL/DB2, from MANTIS to COBOL/DB2,...).
- When you have a elementary item below of only group item so you can use. But the attributes needs to match with DB2.
Example:
01 RECORD-FD.
03 NAMEX PIC X(30). ----> NAMEOFDB2 CHAR(30),
03 ITEMX PIC S9(9) COMP. ---> ITEMOFDB2 INTEGER,
but there are many problems, for example.
01 RECORD-BATCH.
03 BLABLALBA.
05 NAMEX PIC X(30). ---> Problably you will have problem with precompile
There are problem with VARCHAR too.
Regards
Lindovaldo |
|
Back to top |
|
|
|