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
0
votes
0 answers

Error when trying to update the table in IBM DB2 using Merge

I have a SQL statement which I am trying to execute from a console application on IBM DB2 database. MERGE INTO Table 1 AS A USING Table 2 AS B ON A.IDTEXT = B.IDTEXT AND A.STATE = 1 WHEN MATCHED THEN UPDATE SET A.STATE = 5 However, I am getting…
Prasad R
  • 1
  • 3
0
votes
1 answer

Using constants with DB2 UNLOAD utility on DB2 for z

I am working on a data upgrade issue. A new column has been added to our Existing DB2 table. In order to upgrade Client's DB2 table, I am unloading the data from the existing DB2 table with a constant value for the new column(lets say D of type…
Manish
  • 649
  • 2
  • 7
  • 10
0
votes
0 answers

Replace-function via EclipseLink on DB2 z/OS

I am migrating an application from JPA 2.0 with OpenJPA on WebSphere 8.5 to JPA 2.1 with EclipseLink on WebSphere 9.0, using DB2 12 on z/OS. Generally it is working, but one rather complex query is failing. I could localize the problem to the usage…
Christian
  • 558
  • 2
  • 13
0
votes
1 answer

Conditional query on Spring Data JPA gives a -417 error on DB2 (z/OS)

I currently have the following method signature in a Spring Data CrudRepository: @Query("SELECT c FROM Table c WHERE (:paramOne is null or c.fieldOne = :paramOne) AND (:paramTwo is null or c.fieldTwo = :paramTwo)") Iterable…
0
votes
2 answers

Querying a DB2 table using the "DISTINCT" keyword from MSAccess

I've got a rather simple query to a linked DB2 table. SELECT GC_TBSELC.* FROM GC_TBSELC WHERE SELC_EFF_DATE > #1/1/2017#; Works fine, returns results. However, when I add the "DISTINCT" keyword, I get an error: ODBC -- CALL FAILED [[IBM][CLI…
Johnny Bones
  • 8,786
  • 7
  • 52
  • 117
0
votes
2 answers

DB2 performance issue while executing select query

I have this query: SELECT INVOICE_NUMBER, INVOICE_SEQ_NUMBER, FILE_NUMBER, MAX(INVOICE_SEQ_NUMBER) OVER (PARTITION BY INVOICE_NUMBER) AS MAX_INV_SEQ_NUM FROM (SELECT A.INVOICE_NUMBER, A.INVOICE_SEQ_NUMBER, B.FILE_NUMBER, DENSE_RANK()…
Foxy
  • 416
  • 8
  • 18
0
votes
2 answers

DB2 NOT ATOMIC WAS Expected , how can we fix this?

I m not sure , why I am getting the below error, while executing the below SQL in my SQL Editor for DB2 (DB2 for z/OS) DECLARE GLOBAL TEMPORARY TABLE SESSION.VTI_GUI_TMP ( ENCRP_PRC_RL_ID INTEGER NOT NULL, PROC_SYS_CD VARCHAR(10) NOT NULL, …
user1993412
  • 802
  • 2
  • 15
  • 29
0
votes
1 answer

How to execute bind variable based sql in DB2 DB2 ZOS

I am trying to execute one SQL, which is made up of bind variables. It's working fine with ORACLE DB but not with DB2 Here is the sample SQL: (UPPER/UCASE it can be anything) SELECT Col1 FROM tab1 WHERE Col1 = 'abc' AND (UPPER(Col1) LIKE (UPPER(:1)…
cpp_learner
  • 362
  • 2
  • 4
  • 14
0
votes
2 answers

SQLCODE -981, SQLERRMC :00C12219

While running COBOL+DB2 program I am getting SQLCODE -981 SQLERRMC :00C12219. The program is link edited with INCLUDE SYSLIB(DSNELI). What could be the possible reason I am gettibg -981? link edited with INCLUDE SYSLIB(DSNELI).and RRSAF thread shows…
AK1222
  • 1
  • 1
0
votes
1 answer

DB2 tablespaces: "partition-by-range" or "partition-by-growth"

During the upgrade from DB2 9 to DB2 10 on z/OS, the previous (now retired) DBA converted all tablespaces from "simple" to "universal". How can I determine if they are partition-by-range or partition-by-growth? Using RC/Query in CA/Tools from…
Dave Ford
  • 341
  • 2
  • 14
0
votes
2 answers

Can I access tables on SQL Server and DB2 from Mainframe Cobol Programs via BizTalk DRDA Services?

We have Mainframe z/OS COBOL applications accessing set of DB2 tables (T1, T2) from few applications (App1, App2) in a SELECT query. Now, we are moving one of the application (App1) and its tables (T1) to SQL Server (Azure SQL in the future). How do…
Humble
  • 61
  • 5
0
votes
2 answers

ASQL statement for searching SSN number in a table that can have up to 4800 VARCHAR

I am searching for SSN number that was indicated in a Table with 4800 varchar. I tried SSN_MSG Like ‘%[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]%’ But it didn’t work. I need to check for the format of SSN which is SSN 000-00-0000
0
votes
1 answer

SQL0199N error when trying to connect HammerDB to Db2 for z/OS

I'm trying to generate some data for DB2 11.1 z/OS using HammerDB v3.1 which is running on a Windows remote host. There is no ability to run HammerDB on the same host with DB2. According to the HammerDB documentation I need to set up IBM Data Server…
Sergey Konotop
  • 121
  • 1
  • 13
0
votes
1 answer

DB2 Joining a Large Physical table with a small Global Temp table

I have the below requirement of Joining 3 tables a) Table T1 - large physical table with 100 Million rows Index columns: C1, C2, C3 in this order b) Table T2 - Temp table with 50 records contains C2 & additional columns. No Index c) Table T3 -…
nag p
  • 11
  • 1
0
votes
1 answer

Evaluating datetime register during trigger event

I was testing the following behaviour for datetime special register (stated here) If the SQL statement in which a datetime special register is used is in a user-defined function or stored procedure that is within the scope of a trigger, Db2…
sifear
  • 89
  • 7