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
 

 

FD variables as Host variable in Cobol-Db2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Tue Sep 01, 2009 12:18 pm    Post subject: FD variables as Host variable in Cobol-Db2 program
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Sep 02, 2009 12:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 02, 2009 2:44 pm    Post subject:
Reply with quote

.. icon_biggrin.gif
Quote:
If you mean fields of the records, yes you can
I believe no other option is left for OP...
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Sep 02, 2009 2:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 02, 2009 3:01 pm    Post subject:
Reply with quote

Yeah, agree Dick.
Back to top
View user's profile Send private message
Keith Cheetham

New User


Joined: 10 Jan 2012
Posts: 1
Location: USA

PostPosted: Thu Apr 05, 2012 10:56 pm    Post subject: Reply to: FD variables as Host variable in Cobol-Db2 program
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Apr 06, 2012 12:09 am    Post subject:
Reply with quote

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
View user's profile Send private message
lindovaldolpn

New User


Joined: 25 Feb 2010
Posts: 16
Location: Brazil

PostPosted: Fri Apr 06, 2012 12:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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