Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help on DB2 + easytrive

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need help on DB2 + easytrive
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

Site Director


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

PostPosted: Fri Jan 18, 2008 2:42 am    Post subject:
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    Post subject: Reply to: Need help on DB2 + easytrive
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

Site Director


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

PostPosted: Fri Jan 18, 2008 8:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Easytrive Redefine vidyaa CA Products 4 Mon Jun 19, 2017 6:01 pm
No new posts please help how we can achive record ... srinivasulu.p CA Products 1 Tue Jan 21, 2014 8:38 pm
No new posts Need help to develop sort card or eas... Bill Woodger JCL & VSAM 12 Mon Feb 04, 2013 4:15 pm
No new posts how to concatenate strings in easytri... Ragav86 CA Products 2 Thu Mar 01, 2012 12:49 pm
No new posts Need help to suppress zeros in easytrive omprakash.mf CA Products 3 Tue Nov 22, 2011 1:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us