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
 
Regarding data movement in CICS - DB2 program

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

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Tue Jan 25, 2011 12:13 pm    Post subject: Regarding data movement in CICS - DB2 program
Reply with quote

Hi All

I have a input variable XXXX-A PIC S9(9)V9(2).
I want to use this variable in my SQL query so in order to use it an host variable i declared a working storage variable
WS-XXXXX-A PIC S9(9)v9(2) COMP-3

then

MOVE XXXX-A TO WS-XXXXX-A

exec sql
select from
where WS-XXXXX-A = COULUM
en-exec

Is there any mistake in am doing this
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jan 25, 2011 1:03 pm    Post subject:
Reply with quote

depends on the data type of the column.
Back to top
View user's profile Send private message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Tue Jan 25, 2011 1:08 pm    Post subject: Reply to: Regarding data movement in CICS - DB2 program
Reply with quote

Hi

My coulum data type is decimal

and the dclegen am rtreving is PIC S9(8)V9(2) COMP-3
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Jan 25, 2011 1:22 pm    Post subject: Re: Regarding data movement in CICS - DB2 program
Reply with quote

akodakka wrote:
Hi All

I have a input variable XXXX-A PIC S9(9)V9(2).
I want to use this variable in my SQL query so in order to use it an host variable i declared a working storage variable
WS-XXXXX-A PIC S9(9)v9(2) COMP-3

then

MOVE XXXX-A TO WS-XXXXX-A

exec sql
select from
where WS-XXXXX-A = COULUM
en-exec

Is there any mistake in am doing this

You should post source code using BBCode tags, to enhance readability. An do preceede your host variable name with a colon in sql:
Code:

exec sql
select from
where :WS-XXXXX-A = COULUM
en-exec
Back to top
View user's profile Send private message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Tue Jan 25, 2011 1:23 pm    Post subject:
Reply with quote

Hi i am using proper colons..
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Jan 25, 2011 4:06 pm    Post subject:
Reply with quote

Ok, then go ahead and program your SQL.

It is good practice to include the DCLGEN structure for the accessed tables in your program and use the host language definitions of columns as host variables, instead of defining your own working storage elements.
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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Is CICS BMS logic on z/OS different ... Andi1982 CICS 2 Fri Dec 01, 2017 1:56 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm

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