Questions tagged [db2-zos]

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.

175 questions
5
votes
1 answer

How to show present privileges on table in IBM DB2 Z/OS with SQL

Is there an SQL way to show the privileges present on a table or view in DB2 Z/OS? I would like to achieve something like this: select * from sysibm.magic_table where table_name = 'users' |TABLE_NAME|PRIVILEGE_TYPE|USER_OR_GROUP_NAME| | USERS| …
andy
  • 1,035
  • 1
  • 13
  • 35
4
votes
3 answers

Why does FETCH FIRST N ROWS not work in combination with WITH statement?

I have the following SQL statement which does not run on my DB2 database: WITH a AS ( SELECT * FROM sysibm.systables ) SELECT a.* FROM a FETCH FIRST 10 ROWS Without the FETCH statement it works. The error message I get is: Illegal use of…
Boris
  • 76
  • 1
  • 1
  • 5
4
votes
5 answers

How do I script DB2 commands in z/OS?

After 25 years of using DB2 on midrange systems (AS/400, IBM i, etc), I’m now being tasked with being a database administrator for DB2 on the mainframe (z/OS). I apologize for the “rookie questions” here, but I’m still getting my head around the…
Dave Ford
  • 341
  • 2
  • 14
3
votes
0 answers

Exception "Unknown PrimitiveTypeKind DateTimeOffset" when save model in .Net Framework 4.8 in DB2

Came across a problem while working with DB2 from .Net Framework 4.8. We have a Db2 for z/OS v12 database. Our database has fields with type "TIMESTAMP WITH TIME ZONE". When using ADO.NET, these fields in models are of type DateTimeOffset. When…
Toptyzhkin
  • 31
  • 3
3
votes
1 answer

Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object

i am trying to connect db2 from my java code in web sphere application server. i am getting following exception.please suggest any one on this. Caused by: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI…
subbareddy
  • 31
  • 1
  • 4
2
votes
0 answers

DB2 Connect licensing problem (SQLSTATE=42968)

I require DB2 Connect installed on my laptop to allow an application to read a DB2 database on a z/OS box. Due to issues with slow VPN I was unable to download a licensed copy of it from my firms server, so I downloaded a trial version (v9.7) from…
2
votes
1 answer

Exception while connecting spring data config to IBM DB2 z/os

I am getting the following exception while bringing up the spring boot app(app doesnt not have any code just the DB related configs and connection parameters which are defined in the application.properties file) Could not fetch the…
Tarun Shedhani
  • 101
  • 2
  • 7
2
votes
1 answer

how to remove @ character from national data type in cobol

i am facing issue while converting unicode data into national characters. When i convert the Unicode data into national using national-of function, some junk character like @ is appended after the string. E.g Ws-unicode pic X(200) Ws-national…
Rama Gaur
  • 23
  • 2
2
votes
1 answer

DB2 SELECT EXCEPT with WHERE clause

I'm trying to compare two tables in a DB2 database in z/OS using SPUFI to submit SQL queries. I'm doing this by using EXCEPT to see the difference between two SELECT queries. I need to filter the SELECT statement from the first query with a WHERE…
joshi123
  • 835
  • 2
  • 13
  • 33
2
votes
2 answers

Hibernate connecting to DB2 at application startup on WAS Liberty on CICS

We're running a simple webapp on WebSphere Liberty, that uses Hibernate as persistence provider (included as a library in the WAR file). When application is starting up Hibernate is initialized and it will open a connection to DB2 and issue some SQL…
Gediminas Rimsa
  • 608
  • 6
  • 16
1
vote
1 answer

Db2 SQL - how to switch among different where conditions

Need your advice on the below scenario. An old COBOL program has SELECT SQL where it has multiple WHERE clauses. But these WHERE clauses don't act together. Depending on variable values a single WHERE condition is switched on and others are…
Subrata
  • 11
  • 1
1
vote
0 answers

Call Stored Procedure from DBeaver to DB2 not working

I'm trying to call STP from DBeaver or Jmeter with the following command example: @call SCHEMA.STPNAME( ${var_in1||AKTIVIER||String||dir=in noshow}$ , ${var_in2||AP||String||dir=in noshow}$ , ${var_in3||XXX||String||dir=in noshow}$ ,…
atarox
  • 11
  • 2
1
vote
1 answer

DB2 functions returning error SQL CODE 4743?

I've been trying to solve this issue now for a while. I have a table called Students like: ID |Classes |Priority ---------------------------- 3 A51 1 3 B51 2 3 K5B 2 3 M5A 2 4 XN5 …
stackerstack
  • 243
  • 4
  • 16
1
vote
1 answer

Db2 Z/OS Table Size

Is there a way to get table or tablespace size accurately via SQL for Db2 Z/OS? From whatever I can find, there has been information with regards to Db2 LUW but not for z/OS. I found a article for z/OS, which as I understand cannot be done from SQL…
arsm4
  • 101
  • 2
  • 10
1
vote
3 answers

Reduce length of varchar column in db2 table(z/os version)

A have a db2 table with a column col1 varchar(2000). I want to reduce length from 2000 to 1600 byte. It is possible to do this with ALTER? Or in this case, the only valid solution is DROP - CREATE? ALTER COLUMN col1 SET DATA TYPE VARCHAR(1600) --…
neo
  • 33
  • 1
  • 8
1
2 3
11 12