View previous topic :: View next topic
|
Author |
Message |
Ashsih
New User
Joined: 20 Dec 2007 Posts: 29 Location: India
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Ashsih
New User
Joined: 20 Dec 2007 Posts: 29 Location: India
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
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 |
|
 |
|