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
 
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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