DB2 SQL error 100
Moderators: Kalicharan, Moderator Group
-
- Member
- Posts: 7
- Joined: Tue Aug 04, 2009 8:13 pm
DB2 SQL error 100
I am getting 'SQLCODE Return 000000100' in my batch program. When I do SPUFI I acn see the record but in batch I am not able to find the reocrd. Appreciate your answers. Thanks.
Vince
-
- Member
- Posts: 7
- Joined: Tue Aug 04, 2009 8:13 pm
DB2 SQL error 100
This is the query using in the batch:Natarajan wrote:Interesting!!!
Can you post the query used in SPUFI & batch program?
EXEC SQL
SELECT MSTR_NAME
INTO :MSTR-NAME
FROM MASTER_FILE_TBL
WHERE MSTR_NAME = :MSTR-NAME
END-EXEC
DISPLAY 'OPENING MSTR CURSOR 1 = ' MSTR-NAME
In SPUFI:
SELECT *
FROM NASR.MASTER_FILE_TBL
WHERE MSTR_NAME = 'MAT.A0AZ7693.NDM.AZFIPR.DTBG11F1';
Thank you.
Vince
-
- Member
- Posts: 7
- Joined: Tue Aug 04, 2009 8:13 pm
DB2 SQL error 100
Whatever the value is in MSTR_NAME of the DB2 table should be populated in the MSTR-NAME in the host. What am I doing wrong here? Thanks.
Vince
COBOL DB2 SELECT QUERY VS SPUFI
In SPUFI, you provided the value to the query.
In program also, you need to populate cobol host variable with this data, before
executing the query.
You should code the following before embedded sql in cobol..
Code: Select all
MSTR_NAME = 'MAT.A0AZ7693.NDM.AZFIPR.DTBG11F1';
In program also, you need to populate cobol host variable with this data, before
executing the query.
You should code the following before embedded sql in cobol..
Code: Select all
MOVE 'MAT.A0AZ7693.NDM.AZFIPR.DTBG11F1' TO MSTR-NAME.
Natarajan
Chennai
Chennai
-
- Member
- Posts: 7
- Joined: Tue Aug 04, 2009 8:13 pm
DB2 SQL error 100
Thank you for your help. Much appreciated. It works now. I am getting another SQL error code of 00000030L. Does this have to do with the null values? Thanks.
Vince
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-303 A VALUE CANNOT BE ASSIGNED TO
OUTPUT HOST VARIABLE NUMBER
position-number BECAUSE THE DATA
TYPES ARE NOT COMPARABLE
Code: Select all
**********************************************************************
* VALUES: *
* 1 = A -1 = J EXAMPLES: NUMBER REPRESENTATION *
* 2 = B -2 = K 10 00000001{ *
* 3 = C -3 = L 105 00000010E *
* 4 = D -4 = M 0 00000000{ *
* 5 = E -5 = N -234 00000023M *
* 6 = F -6 = O -30 00000003} *
* 7 = G -7 = P *
* 8 = H -8 = Q *
* 9 = I -9 = R *
* 0 = { ? -0 = } ? *
**********************************************************************
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 7
- Joined: Tue Aug 04, 2009 8:13 pm
DB2 SQL error 100
Thank you for the reply. My code looks like:
EXEC SQL
FETCH MSTR-SWEEP-TBL-CSR
INTO
:MSTR-NAME,
:HV-NULL-FREQ,
:HV-NULL-IND,
:HV-NULL-JOB,
:HV-NULL-JUR,
:HV-NULL-LOB,
:MSTR-FAL-IND,
:MSTR-TRN-IND,
:MSTR-PRNT-IND,
:MSTR-APP-IND,
:MSTR-EDI-IND,
:MSTR-SECUR-IND
END-EXEC.
IF SQLCODE = 0
SET RECORD-FOUND TO TRUE
Do I need to change the host variables to the original names instead of :HV-NULL? Thanks.
EXEC SQL
FETCH MSTR-SWEEP-TBL-CSR
INTO
:MSTR-NAME,
:HV-NULL-FREQ,
:HV-NULL-IND,
:HV-NULL-JOB,
:HV-NULL-JUR,
:HV-NULL-LOB,
:MSTR-FAL-IND,
:MSTR-TRN-IND,
:MSTR-PRNT-IND,
:MSTR-APP-IND,
:MSTR-EDI-IND,
:MSTR-SECUR-IND
END-EXEC.
IF SQLCODE = 0
SET RECORD-FOUND TO TRUE
Do I need to change the host variables to the original names instead of :HV-NULL? Thanks.
Vince
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page