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

Need help on DB2 + easytrive


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

New User


Joined: 20 Dec 2007
Posts: 29
Location: India

PostPosted: Sat Jan 12, 2008 5:11 pm
Reply with quote

Code:
                                                                       
//STEP1   EXEC PGM=EZTPA00
//SYSPRINT  DD SYSOUT=*                                 
//OUTFILE   DD DSN=APG.DAILY.DUNSFILE.DOESNA.FEB04, 
//             DISP=(,CATLG,DELETE),             
//             SPACE=(TRK,(2,2),RLSE),               
//             RECFM=FB,LRECL=25
//SYSOUT   DD  SYSOUT=*                             
//SYSIN DD *                                         
PARM DB2SSID(DSN)                                   
 FILE OUTFILE                                           
   OUT-REC                       1  25   A             
   OUT-DUNS-NBR                  1   9   N             
                                                       
  WORKING STORAGE                                       
                                                       
   WS-RECORDS-READ        W     09   N 0               
   WS-RECORDS-WRITTEN     W     09   N 0               
   WS-DUNS-NUMBER         W     09   N 0               
                                                       
   DEFINE REC-CNT1        W     11   N 0               
                                                       
   SQL DECLARE C001 CURSOR FOR  +                       
      SELECT DUNS_NBR           +                       
      FROM ITS.DMSBUSINESS                             
JOB INPUT (NULL) FINISH (DISPOT)           
                                           
SQL OPEN C001                             
  IF REC-CNT1 < 100000                     
  PERFORM FETCH-MDB-ROWS                   
  REC-CNT1 = REC-CNT1 + 1                 
  END-IF                                   
SQL CLOSE C001                             
FETCH-MDB-ROWS. PROC                       
SQL FETCH C001 INTO  :WS-DUNS-NUMBER       
IF  SQLCODE NE 0       +                   
AND SQLCODE NE 100                         
                                           
DISPLAY 'ERROR IN FETCH ORDR'             
END-IF                                     
 IF SQLCODE EQ 0                                                     
                                                                     
*   REC-READ          = REC-READ    + 1                             
    OUT-DUNS-NBR      = WS-DUNS-NUMBER                               
    PUT OUTFILE                                                     
 END-IF                                                             
 END-PROC                                                           
********************************************************************
*  DISPTOT PROC                                                     
********************************************************************
DISPOT. PROC                                                         
*                                                                   
*     DISPLAY 'NO: OF RECORDS READ :' WS-RECORDS-READ               
*     DISPLAY 'NO: OF RECORDS WRITTEN :' WS-RECORDS-WRITTEN         
      DISPLAY '******* PROGRAM ENDED  **************** '             
END-PROC.                                                           
********************************************************************


When i running this JCl i am getting following error

OPTIONS FOR THIS RUN - ABEXIT SNAP DEBUG (STATE FLDCHK NOXREF) LIST (PARM FILE) PRESIZE 512
SORT (DEVICE SYSDA ALTSEQ NO MSG DEFAULT MEMORY MAX WORK 3) VFM ( 64)
DB2SSID('DSN ')
*******B204 SQL - SQL ERRORS FOUND
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jan 18, 2008 2:42 am
Reply with quote

Hello,

I'm not able to test this, but you may need a CONNECT to the database after the JOB statement / before the cursor OPEN statement.

Quote:
SQL CONNECT :USERID IDENTIFIED BY :PASSWORD
Back to top
View user's profile Send private message
Ashsih

New User


Joined: 20 Dec 2007
Posts: 29
Location: India

PostPosted: Fri Jan 18, 2008 12:02 pm
Reply with quote

Thanks !!!!!!!!!!!!
This code is working in SQA region but when same code just changing in Production region it's saying DB2 production subsystem is inactive . What does it mean?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jan 18, 2008 8:55 pm
Reply with quote

You're welcome icon_smile.gif

I'd suggest you talk with your dba(s). It sounds like there might be a different subsystem name for production, but i have no idea as to what it might be.
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 Easytrive Redefine CA Products 4
No new posts please help how we can achive record ... CA Products 1
No new posts Need help to develop sort card or eas... JCL & VSAM 12
No new posts how to concatenate strings in easytri... CA Products 2
No new posts Need help to suppress zeros in easytrive CA Products 3
Search our Forums:

Back to Top