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

Accessing DB2 using FOCUS program


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Wed Dec 31, 2008 5:18 pm
Reply with quote

Hi,

I was trying to access DB2 table through FOCUS. But i was getting some error. Please find below the details of the JCL, FOCSQL, MFD, FOCEXEC and the problem occured

FOCSQL

Code:

SEGNAME=ESPRGN,TABLENAME="TAH1"."D772701T"."ESARGN",
KEYS=1,WRITE=YES,KEYORDER=LOW,$                     


MFD

Code:

FILENAME=MASTER03, SUFFIX=SQLDS,                                             $
SEGNAME=ESARGN,  SEGTYPE=S0,                                                   $
 FIELDNAME=ENGR_RGN_OFC_ID,  ALIAS=NM,      FORMAT=A2,          $
 FIELDNAME=ENGR_RGN_OFC_NM,  ALIAS=NA,      FORMAT=A20,        $


FOCEXEC

Code:

TSO SQL SET SSID TDH1
SET SQLENGINE=DB2   
TABLE FILE MASTER03 
PRINT *             
END                 


JCL

Code:

//BATTSO EXEC PGM=IKJEFT01                                   
//*                                                         
//STEPLIB DD DISP=SHR,DSN=SYSAFOC.FOCSQL.LOAD               
//        DD DISP=SHR,DSN=SYSAFOC.FOCUS.LOAD                 
//        DD DISP=SHR,DSN=SYSAFOC.FUSELIB.LOAD               
//        DD DSN=SYSAPDH1.DSNLOAD,DISP=SHR                   
//        DD DSN=SYSA.LE.SCEERUN,DISP=SHR                   
//USERLIB  DD DSN=SYSAFOC.FUSELIB.LOAD,DISP=SHR             
//ERRORS  DD DISP=SHR,DSN=SYSAFOC.ERRORS.DATA               
//MASTER01 DD DSN=N4AAFD.FOCUS.HOSTFILE,DISP=SHR             
//MASTER02 DD DSN=N4AAFD.FOCUS.CRFILE,DISP=SHR               
//FOCEXEC DD DISP=SHR,DSN=N4AAFD.FOCUS.FOCEXEC               
//MASTER  DD DISP=SHR,DSN=N4AAFD.FOCUS.MASTER               
//FOCSQL  DD DISP=SHR,DSN=N4AAFD.FOCUS.FOCSQL               
//FOCSTACK DD UNIT=SYSDA,SPACE=(TRK,(5,5))                   
//FOCSORT  DD UNIT=SYSDA,SPACE=(TRK,(5,5))                   
//HOLD     DD UNIT=SYSDA,SPACE=(TRK,(5,5))                   
//HOLDMAST DD UNIT=SYSDA,SPACE=(TRK,(5,5,5))                 
//HOLDACC  DD UNIT=SYSDA,SPACE=(TRK,(5,5,5))                 
//OFFLINE  DD SYSOUT=*                                       
//SYSPRINT DD SYSOUT=*                                       
//SYSTSPRT DD SYSOUT=*                                           
//SYSTSIN  DD *                                                 
  DSN SYSTEM(TDH1)                                               
  RUN PROGRAM(FOCUS) PLAN(DSNTIAUL) LIBRARY('SYSAFOC.FOCUS.LOAD')
  END                                                           
//SYSIN DD *                                                     
  EX FOCEXE01                                                   
/*                                                               


when i execute the JCL i get the following error

Code:

   TABLE FILE MASTER03                         
   PRINT *                                     
   END                                         
(FOC1400) SQLCODE IS 15925321 (HEX: 00F30049)   
(FOC1406) SQL OPEN CURSOR ERROR.  : ESPRGN     


Could you please help me findout what the issue is?
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: Wed Dec 31, 2008 10:59 pm
Reply with quote

Hello,

You need to post the cursor open error. . .

What does the manual have to say about the FOC1406 message?
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Mon Jan 05, 2009 2:41 pm
Reply with quote

There is nothing else present in the sysout.

This is what i got from the manual.

(FOC1406) SQL OPEN CURSOR ERROR.
An error condition occurred while attempting to open a cursor in the RDBMS. An additional error message specifying the appropriate RDBMS error code will usually accompany this message. Consult the appropriate RDBMS error message reference for proper corrective measures
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: Mon Jan 05, 2009 8:45 pm
Reply with quote

Hello,

You need to find why the cursor open failed.

Quote:
There is nothing else present in the sysout.
There is something else somewhere. . .

What does the manual say about
Code:
(FOC1400) SQLCODE IS 15925321 (HEX: 00F30049)
?

Do you have anything that successfully accesses a db2 table using FOCUS or is this the first attempt?
Back to top
View user's profile Send private message
srajendran2

New User


Joined: 13 May 2008
Posts: 56
Location: Chennai

PostPosted: Wed Jan 07, 2009 5:18 pm
Reply with quote

This is my first attempt. I figured out the error. I was trying to execute the program FOCUS through IKJEFT01 using a plan. while executing like this i got the error. BUt when i executed the focus as PGM=FOCUS, i was able to get teh desired result. Thanks for the help
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: Wed Jan 07, 2009 11:54 pm
Reply with quote

Good to hear it is working - thank you for the follow-up icon_smile.gif

d
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top