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

Problem with the load utility - Load From Cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kothamasu

New User


Joined: 28 Jan 2008
Posts: 6
Location: Sandton

PostPosted: Wed Mar 26, 2008 8:53 pm
Reply with quote

Hi,

I am trying to laod data into a table using Load from cursor.

I am using the below JCL.

//STEP1 EXEC PGM=DSNUTILB,PARM='FDDG,SCOBVER'
//SYSPRINT DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(500,250))
//SYSPUNCH DD DUMMY
//SYSIN DD *
EXEC SQL
DECLARE C1 CURSOR FOR
SELECT * FROM NORD00.T_PLCY_SCOB_VER
WHERE PLCY_ID IN (265943794,731986307)
AND END_DTE_DTS < (CURRENT TIMESTAMP - 14 MONTHS)
END-EXEC;
LOAD FROM C1 OF CURSOR INSERT INTO NORD01.T_PLCY_SCOB_VER;


When I ran this JCL, I am getting the below error message.

DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = SCOBVER
DSNUGTIS - PROCESSING SYSIN AS EBCDIC
DSNUGPSP - EXEC SQL
DSNUGPSP - INSUFFICIENT OPERANDS FOR KEYWORD 'EXEC'
DSNUGPSP - DECLARE C1 CURSOR FOR
DSNUGPSP - SELECT * FROM NORD00.T_PLCY_SCOB_VER
DSNUGPSP - WHERE PLCY_ID IN (265943794,731986307)
DSNUGPSP - AND END_DTE_DTS < (CURRENT TIMESTAMP - 14 MONTHS)
DSNUGPSP - END-EXEC
DSNUGPSP - LOAD FROM C1 OF CURSOR INSERT INTO NORD01.T_PLCY_SCOB_VER
DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8

What could probably be the reason for this?

Thanks,
Kothamasu.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Mar 26, 2008 10:47 pm
Reply with quote

Why are you using a cursor? Why not just use this?

Code:

INSERT INTO NORD01.T_PLCY_SCOB_VER         
 (SELECT *
  FROM NORD00.T_PLCY_SCOB_VER   
  WHERE PLCY_ID IN (265943794,731986307)
  AND END_DTE_DTS < (CURRENT TIMESTAMP - 14 MONTHS);                     

COMMIT;                                   
Back to top
View user's profile Send private message
kothamasu

New User


Joined: 28 Jan 2008
Posts: 6
Location: Sandton

PostPosted: Thu Mar 27, 2008 12:52 pm
Reply with quote

I have to load a total of 30 million records. So, to increase the Insert performence, I am trying to use the cursor.
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Thu Mar 27, 2008 1:03 pm
Reply with quote

As stodolas Sugessted use

Code:
INSERT INTO NORD01.T_PLCY_SCOB_VER         
 (SELECT *
  FROM NORD00.T_PLCY_SCOB_VER   
  WHERE PLCY_ID IN (265943794,731986307)
  AND END_DTE_DTS < (CURRENT TIMESTAMP - 14 MONTHS);                     

COMMIT; 


One thing I didn't understand is that why you have used EXEC SQL

I fell that EXEC SQL is used only in EMBEDED PROGRAMING..
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 27, 2008 7:38 pm
Reply with quote

Hello,

Quote:
I have to load a total of 30 million records. So, to increase the Insert performence, I am trying to use the cursor.
If you really want to improve performance, you might look into running this as 2 steps. The first to create a qsam file of the info to be loaded and the second to actually load the data using the load utility.

30million individual inserts is (probably) the highest overhead way to get the data into the table. . .
Back to top
View user's profile Send private message
kothamasu

New User


Joined: 28 Jan 2008
Posts: 6
Location: Sandton

PostPosted: Fri Mar 28, 2008 8:58 pm
Reply with quote

Hi,

I read the concept of loading the table using a Cursor in one of the White Papers. They mentioned like, if we are loading the table using a cursor, the performence can be increased by 20%.

Actually I have to load a total 9 tables which are almost of equal size. That's why I am looking for a better option.

Thanks for the feed back.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts REASON 00D70014 in load utility DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
Search our Forums:

Back to Top