Use this tag for questions about DB2 for z/OS, the IBM mainframe operating system. Please also tag such questions with the more generic [db2] tag. There are enough differences between DB2 for z/OS and DB2 for other platforms to warrant a separate tag.
Questions tagged [db2-zos]
175 questions
1
vote
1 answer
Error while connecting to DB2 zOS Database using Java
Getting the below error while connecting to DB2 zOS server.
Can someone please help?
We have used Jar file db2jcc4.jar for the same along with other JDBC related Jar files.
Do I need to use "db2jcc_license_cu.jar" file as well?
I am getting…

Pranav
- 363
- 8
- 19
1
vote
1 answer
Creating table partitions in DB2 for Z/OS
Can we create a table which is range partitioned where partition keys are not in order?
For eg.
PARTITION 00001 ENDING AT ('2018-07-02') INCLUSIVE
PARTITION 00002 ENDING AT ('2018-07-03') INCLUSIVE
PARTITION 00003 ENDING AT ('2018-07-08')…

Tejasvi Rao
- 53
- 1
- 6
1
vote
0 answers
IBM DB2 - Query optimization
Problem
I have a table and I need to make a selection using the following rules,
AUFT_LOESCH_KZ can't be null
AUFT_AUFT_ART has to be E
AUFT_FZG_ART can be 0,1,2,E,F or G
If AUFT_PAT(date) Year is the same as the current year then I want to select…

Matheus Souza
- 127
- 9
1
vote
1 answer
Z/OS DB2 via IBM.Data.DB2
I am using IBM.Data.DB2 via C# to access a DB2 database on our mainframe Z/OS. Unfortunately I receive "DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=USER_NAME;EXECUTE PACKAGE;NULLID.SYSLH200, DRIVER=4.19.56"
I received the same error when I…

Gollum
- 33
- 3
1
vote
2 answers
DB2 SQL reading 2 tables using group by
I need to read 2 tables selecting unique dates and count the number of entries from both tables by date.
Example:
table 1 table 2
date date
---------- --------
2018-03-20 …

Leila
- 11
- 1
1
vote
3 answers
DB2 11 query with anonymous table or hard list of values
I'd like a DB2 compatible query for all the values in my own hardcoded list of values that are NOT in a table. This query works well in Microsoft SQL Server
SELECT * FROM
(values (1),(2),(3),(4),(7), (7000000)) as T(ID)
EXCEPT
SELECT ID
FROM…

SpareTheRod
- 476
- 6
- 13
1
vote
0 answers
DB2 Z/OS PYTHON connection
i am trying to do my first connection to DB2 Z/OS from Python from windows 64 bit. I have downloaded & successfully install python 2.7.9. according to the doc I also need ibm_db eggs and which is supposed to be installed from C:\Python27\Scripts. I…

deb
- 21
- 1
1
vote
1 answer
DB2 System Runtime Table to retrieve last executed SQL Statement
Is there a DB2 System Table - Batch Runtime log in Mainframe? In DB2 for i Series, there is a table function QSYS2.GET_JOB_INFO() that returns Job Information during runtime including the Status (Active /Complete) and most importantly…

Cee
- 11
- 3
1
vote
2 answers
What is the maximum number of table names under a single schema in a DB2 subsystem?
What is the maximum number of results possible from the following SQL query for DB2 on z/OS?
SELECT NAME FROM SYSIBM.SYSTABLES WHERE TYPE='T' AND CREATOR=? ORDER BY NAME ASC
This query is intended to fetch a list of all table names under a specific…

Josh Broadhurst
- 407
- 3
- 14
1
vote
0 answers
While trying to insert nosql document into IBM Db2 z/os, getting DSN5JSJb module is not found. But it's there already in environment?
While inserting json document in to table facing the mentioned error. Though I created UDF where external name is DSN5JSJb and it's already there in environment. Which will come along with Db2 accessories suit.

Dhinesh Pazanisamy
- 45
- 1
- 6
1
vote
1 answer
Do we have anything similar "Database Change Notification" in DB2
Do we have anything similar in DB2 z/os as Database Change Notification in Oracle which could be of help to get event at java server side if any change in database .

AngelEye
- 11
- 2
1
vote
1 answer
Insert with Select give sql-error (SQLCODE=-803, SQLSTATE=23505)(db2 z/os)
I try to insert values from my java application and values from table1 into table2. I get the following error(db2 z/os):
Exception in thread "main" com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-803,…

SamuelTJackson
- 1,357
- 3
- 19
- 40
1
vote
1 answer
Why am I getting error -4700 (attempt to use new function mode) when running a query?
I tried running the query in SPUFI as :
select * from (select * from emptable
order by empno asc fetch first 10 rows only) as A
order by empno desc fetch first 1 rows only;
The error returned is :
sqlcode = -4700, error: attempt to use new…

sleeper
- 31
- 4
1
vote
1 answer
"VALUE ... IS TOO LONG" error in a recursive query that concatenates characters
While executing this query
WITH A (DOC_STRING,ROW_NUM) AS
(SELECT CAST('A' AS VARCHAR(1)),1
FROM SYSIBM.SYSDUMMY1
UNION ALL
SELECT CAST('B' AS VARCHAR(1)),2
FROM SYSIBM.SYSDUMMY1
…

Nik
- 9
- 1
1
vote
1 answer
DB2 z/OS hierarchical queries
I have a table with two columns, PARENT_PART & CHILD_PART.
I need all the linked details if the part is entered. All the child parts for that part need to be in the results.
Parent part Child part
OABCDEFG01 OABCDEFG02
OABCDEFG01 …