How to use Join while using DSNUTILB for unload



IBM's flagship relational database management system

How to use Join while using DSNUTILB for unload

Postby Prasanna G » Thu Jul 04, 2024 10:14 am

Hi

Can anyone let me know the sample unload card that can be used to unload table A by joining Table B. I am getting error when I try to use the below control card


UNLOAD TABLESPACE DBAPC001.TSAPCACT PART 5
NOPAD MAXERR 1
SHRLEVEL CHANGE ISOLATION UR
FROM APCWTBT.TBAPCACT A, DGSWTBT.TBDGSACT B
WHERE A.MLACNO =B.MLACNO
 


Error

INVALID OPERAND 'A' FOR KEYWORD 'FROM'
 
User avatar
Prasanna G
 
Posts: 71
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to use Join while using DSNUTILB for unload

Postby sergeyken » Fri Jul 05, 2024 5:35 am

RTFM:
1) UNLOAD TABLESPACE syntax is not compatible with FROM TABLE syntax.
2) FROM TABLE syntax is not the same as SELECT FROM syntax

Read here carefully
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 419
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: How to use Join while using DSNUTILB for unload

Postby Prasanna G » Fri Jul 05, 2024 5:51 am

Hi Sergeyken

Is it possible to get the table A partition 5 data based on joining with table B. I know

Select a.* From table1 a, table2 b
Where a.key=b.key
 


Works.. is there any other way
User avatar
Prasanna G
 
Posts: 71
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to use Join while using DSNUTILB for unload

Postby sergeyken » Fri Jul 05, 2024 5:06 pm

Prasanna G wrote:Hi Sergeyken

Is it possible to get the table A partition 5 data based on joining with table B. I know

Select a.* From table1 a, table2 b
Where a.key=b.key
 


Works.. is there any other way

The SELECT statement, and UNLOAD utility - those are two completely different entities.
Is your problem with either SELECT, or UNLOAD?
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 419
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: How to use Join while using DSNUTILB for unload

Postby Prasanna G » Fri Jul 05, 2024 5:11 pm

I would like to unload the partition 5 of table A for the matching rows of Table B.
User avatar
Prasanna G
 
Posts: 71
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to use Join while using DSNUTILB for unload

Postby sergeyken » Fri Jul 05, 2024 6:05 pm

Prasanna G wrote:I would like to unload the partition 5 of table A for the matching rows of Table B.

Why not to read the manual on UNLOAD utility?

Plus: read #1 of my first reply.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 419
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post