Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Wed Feb 26, 2003 1:12 am Post subject: Easytrieve + DB2
Hi,
I am interested in knowing the way in which you can access DB2 tables through Easytrieve. Is it that you write embedded SQLs in the Easytrieve programs just like you do in COBOL or use some standard APIs to do the same by passing the SQL as a parameter to standard APIs. If you see how DB2 tables are accessed in REXX, it is by use of some standard APIs. As Easytrieve is also basically an interpreted language, I was thinking if the same happens in this case also.
If embedded SQLs are used in Easytrieve, I would also like to know how you connect to the DB2 subsystem when you run the program. It cannot be run through IKJEFT01...right??
SQL INCLUDE LOCATION W FROM YOURDB2TABLE1
*
SQL DECLARE YOURCSR CURSOR FOR +
SELECT COLUMN1, +
COLUMN2 +
FROM YOURDB2TABLE1 +
WHERE YOUR CONDITION
*
JOB INPUT (INFILE) START(INIT-RTN) FINISH (LAST-RTN)
SQL OPEN YOURCSR
IF SQLCODE NE 0 AND SQLCODE NE 100
DISPLAY ' SQL CODE : ' SQLCODE
END-IF
*
*
SQL FETCH YOURCSR +
INTO :WS-COL1, +
:WS-COL2
*
*
IF SQLCODE NE 0 AND SQLCODE NE 100
DISPLAY ' SQL CODE : ' SQLCODE
END-IF
*
SQL CLOSE YOURCSR
*
*
IF SQLCODE NE 0 AND SQLCODE NE 100
DISPLAY ' SQL CODE : ' SQLCODE
END-IF
*
INIT-RTN. PROC
DISPLAY 'Easytrieve DB2 Process Started'
END-PROC
*
LAST-RTN. PROC
DISPLAY 'Easytrieve DB2 Process Ended'
END-PROC
/*
//
_________________ Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
Posted: Thu Feb 27, 2003 1:04 am Post subject:
Hi ravijaya,
Thanks a lot for your response. I talked about Easytrieve being an interpreted language because in our system, we primarily don't compile any easytrieve programs. We give them in the SYSIN of EZTPA00. The whole program is interpreted during runtime. Please correct me if I am wrong. I know that you can also use the compiled version of Easytrieve but I personally have never used that.
Hi Venkata Ramana Reddy,
Thanks a lot for your code. It was really helpfull. I have never really worked a lot on Easytrieve expect for a couple of programs almost a year back. I guees, I have to refresh a little on that.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum