DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.

Oleg Dayneko

DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.

Hi! I have typical task. I must unload rows from table1 and load into table2 usage condition.

I choice standard db2 utilities: unload,load.

Table1 and Table2 created in CCSID ASCII.

I usage JCL SYSIN for unload:

//SYSIN DD *
UNLOAD TABLESPACE IBDTNERD.TS#RGRDS
FROM TABLE
"NRM"."NORM_RGR_DNDS"
WHEN (YEARMONTH_TP = '201601')
/*

YEARMONTH_TP  CHAR(6)

But no rows unloaded.But if I usage sql: select count(*) from "NRM"."NORM_RGR_DNDS" where YEARMONTH_TP = '201601'; the result returns some rows.

Note: When I create new table3 with CCSID EBCDIC and insert test data, then utility unload some rows.

Any help would be appreciated! 

 

Walter Janißen

AW: DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.
(in response to Oleg Dayneko)
Hi

That’s strange. When I ran the following unload:

UNLOAD TABLESPACE DSNDB06.SYSTSTAB
FROM TABLE SYSIBM.SYSTABLES
WHEN (NAME= 'SYSTABLES')

I got 8 rows returned. Which DB2 version did this unload run in?

Kind regards
Walter Janißen [standard_IBM+Champ+7+Yr+Analytics]

ITERGO Informationstechnologie GmbH
Anwendungsentwicklung
Technische Anwendungsarchitektur
Victoriaplatz 2
D-40198 Düsseldorf
[login to unmask email]<mailto:[login to unmask email]>

ITERGO Informationstechnologie GmbH
Vorsitzender des Aufsichtsrats: Christian Diedrich
Geschäftsführung: Dr. Bettina Anders (Vorsitzende),
Lothar Engelke, Ina Kirchhof, Dr. Michael Regauer
Sitz: Düsseldorf, Handelsregister: Amtsgericht Düsseldorf HRB 37996

Von: Oleg Dayneko [mailto:[login to unmask email]
Gesendet: Freitag, 3. März 2017 09:11
An: [login to unmask email]
Betreff: [DB2-L] - DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.


Hi! I have typical task. I must unload rows from table1 and load into table2 usage condition.

I choice standard db2 utilities: unload,load.

Table1 and Table2 created in CCSID ASCII.

I usage JCL SYSIN for unload:

//SYSIN DD *
UNLOAD TABLESPACE IBDTNERD.TS#RGRDS
FROM TABLE
"NRM"."NORM_RGR_DNDS"
WHEN (YEARMONTH_TP = '201601')
/*

YEARMONTH_TP CHAR(6)

But no rows unloaded.But if I usage sql: select count(*) from "NRM"."NORM_RGR_DNDS" where YEARMONTH_TP = '201601'; the result returns some rows.

Note: When I create new table3 with CCSID EBCDIC and insert test data, then utility unload some rows.

Any help would be appreciated!



-----End Original Message-----
Attachments

  • image001.png (2.6k)

Chris Tee

DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.
(in response to Oleg Dayneko)
Oleg


The Utility Guide says "

To use a constant when the target table is ASCII, specify the
hexadecimal form of the constant (instead of the character string form) in the condition for the WHEN clause."

regards

Chris



________________________________
From: Oleg Dayneko <[login to unmask email]>
Sent: 03 March 2017 08:11
To: [login to unmask email]
Subject: [DB2-L] - DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.


Hi! I have typical task. I must unload rows from table1 and load into table2 usage condition.

I choice standard db2 utilities: unload,load.

Table1 and Table2 created in CCSID ASCII.

I usage JCL SYSIN for unload:

//SYSIN DD *
UNLOAD TABLESPACE IBDTNERD.TS#RGRDS
FROM TABLE
"NRM"."NORM_RGR_DNDS"
WHEN (YEARMONTH_TP = '201601')
/*

YEARMONTH_TP CHAR(6)

But no rows unloaded.But if I usage sql: select count(*) from "NRM"."NORM_RGR_DNDS" where YEARMONTH_TP = '201601'; the result returns some rows.

Note: When I create new table3 with CCSID EBCDIC and insert test data, then utility unload some rows.

Any help would be appreciated!



-----End Original Message-----

Oleg Dayneko

RE: DB2v10.1 for Z/OS.UNLOAD UTILITY with WHEN clause.
(in response to Chris Tee)

 

I convert '201601' to  x'323031363031', and unload perform correctly. Thank you!