Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Accessing DB2 using FOCUS program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
srajendran2

New User


Joined: 13 May 2008
Posts: 43
Location: Chennai

PostPosted: Wed Dec 31, 2008 5:18 pm    Post subject: Accessing DB2 using FOCUS program
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

Site Director


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

PostPosted: Wed Dec 31, 2008 10:59 pm    Post subject:
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: 43
Location: Chennai

PostPosted: Mon Jan 05, 2009 2:41 pm    Post subject:
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

Site Director


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

PostPosted: Mon Jan 05, 2009 8:45 pm    Post subject:
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: 43
Location: Chennai

PostPosted: Wed Jan 07, 2009 5:18 pm    Post subject:
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

Site Director


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

PostPosted: Wed Jan 07, 2009 11:54 pm    Post subject: Reply to: Accessing DB2 using FOCUS program
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Accessing first bit of PD value rajatbagga DFSORT/ICETOOL 11 Wed May 03, 2017 6:03 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us