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

FD variables as Host variable in Cobol-Db2 program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Tue Sep 01, 2009 12:18 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Sep 02, 2009 12:13 pm
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

Superior Member


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

PostPosted: Wed Sep 02, 2009 2:44 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Sep 02, 2009 2:52 pm
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

Superior Member


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

PostPosted: Wed Sep 02, 2009 3:01 pm
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
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: 6966
Location: porcelain throne

PostPosted: Fri Apr 06, 2012 12:09 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top