View previous topic :: View next topic |
Author |
Message |
gauri Beginner
Joined: 26 Mar 2004 Posts: 3 Topics: 1
|
Posted: Fri Mar 26, 2004 1:47 pm Post subject: CICS db2 |
|
|
How to write db2 statement in cics
why suffix 'D' use with cics dataname variables like customerD instead of
suffix I/O like CustomerI /O |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12381 Topics: 75 Location: San Jose
|
Posted: Fri Mar 26, 2004 2:30 pm Post subject: |
|
|
Gauri,
You would code your sql statements in between exec sql and end-exec.
Code: |
EXEC SQL
SELECT COL1
,COL2
INTO :WS-COL1
,:WS-COL2
FROM TABLE
WHERE COL1 = ...
END-EXEC
|
Code: |
why suffix 'D' use with cics dataname variables like customerD instead of
suffix I/O like CustomerI /O
|
May be it is your shop standard. I guess the Suffix is D is coded to distinguish from the map variables. The vairables generated from the MAP will have a suffix of A,C,P,H,V,O
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
gauri Beginner
Joined: 26 Mar 2004 Posts: 3 Topics: 1
|
Posted: Sun Mar 28, 2004 11:18 am Post subject: |
|
|
yes, host lanuage is COBOL , but using CICS -dc system and using Sql statement within that . |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12381 Topics: 75 Location: San Jose
|
Posted: Sun Mar 28, 2004 9:05 pm Post subject: |
|
|
ravi,
I am lost. can you elaborate more on what you said?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12381 Topics: 75 Location: San Jose
|
Posted: Mon Mar 29, 2004 6:50 am Post subject: |
|
|
Ravi,
I ain't kidding. I just could not understand what you are trying to tell. It is assumed that there is a host langugage involved.
Gauri: There is nothing like DC system in CICS. May be you are confused with IMS DC
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
gauri Beginner
Joined: 26 Mar 2004 Posts: 3 Topics: 1
|
Posted: Mon Mar 29, 2004 10:40 am Post subject: |
|
|
hi ravi &kolusu
I am in learning stage of mainframe so forgive me if i am wrong
i will simplify my qtn
I want to insert data in to table name employee using cics
so i did following steps
1.Include sqlca
2.Include employee
3. Copy mapset where all the field names get copied in to the appl program like emp-name , emp-no
while accepting Data from user I use empname-D (i guess D stands for data ) (receive emp name from screen)
normally In CICS for input - data always field name with suffix 'I' is use and for output - field name with suffix 'O' is use e.g emp-nameI ,emp-nameO
My qtn is while writing DB statement in CICS , why only suffix 'D' is use for input output fieldname instead of 'I'/'O'? Is their any specific reason ?
am i missing somewhere.. please help me and thanks for your reply |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12381 Topics: 75 Location: San Jose
|
Posted: Mon Mar 29, 2004 11:22 am Post subject: |
|
|
Gauri,
please avoid using chatroom language. Don't think to much into definition of the variables. Use the notation which is universally used every where. When you receive data from screen , you will recieve into 'I' suffix data items. when you send a map you will be populating the data variables suffixed with 'o'. This notation is universal and in my opinon the right way to do things. All your questions are revolving around " why D suffix for field-names? You are spending too much time on unnecessary things rather than on concentrating on grasping the concepts. The below example does not use any D suffix variables.
Code: |
EXEC CICS
RECEIVE MAP('Map Name')
MAPSET('Map set Name')
INTO(copy book of map Name with suffix I fields)
RESP(W-RESP)
END-EXEC
|
Now just move the data variables after performing the validation you received to the host variables of the table.
Code: |
MOVE EMP-NAMEI TO EMP-NAME OF EMPLOYEE
MOVE EMP-IDI TO EMP-ID OF EMPLOYEE
....
PEFORM INSERT-INTO-DB2-TABLE
INSERT-INTO-DB2-TABLE.
EXEC SQL
INSERT INTO EMPLOYEE (EMP_NAME
,EMP_ID
....
)
VALUES (:EMPLOYEE.EMP-NAME
,:EMPLOYEE.EMP-ID
....
)
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|