IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Option of using DSNUTILB alone for unload


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Alice

New User


Joined: 04 Jun 2009
Posts: 4
Location: India

PostPosted: Thu Jun 04, 2009 11:05 am
Reply with quote

I have the option of using DSNUTILB alone for unload.

Is it possible to use SUBSTR function in the WHEN clause of UNLOAD command.

When I enter the following in SYSIN

UNLOAD TABLESPACE <TS Name>
FROM TABLE <Table name>
WHEN ((SUBSTR(<Column Name>,m,n)) = '<value>')

I get the message " INVALID KEYWORD - <column name>"
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Jun 04, 2009 1:06 pm
Reply with quote

post your sysout and sysprint messages..
Back to top
View user's profile Send private message
Alice

New User


Joined: 04 Jun 2009
Posts: 4
Location: India

PostPosted: Thu Jun 04, 2009 2:19 pm
Reply with quote

Only Sysprint is available..
DSNU082I DSNUGPRW - INVALID KEYWORD - <Column Name>
DSNU012I DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST RETURN CODE=8
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 2:27 pm
Reply with quote

Try:
WHEN (SUBSTR(<Column Name>,m,n) = '<value>')
Back to top
View user's profile Send private message
Alice

New User


Joined: 04 Jun 2009
Posts: 4
Location: India

PostPosted: Thu Jun 04, 2009 2:30 pm
Reply with quote

I first tried this only. It gave the same error. Thats why I included extra paranthesis.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 3:05 pm
Reply with quote

try (column_name LIKE ...)

it appears that the predicate options of the WHEN clause are rather restrictive.
I would not be surprised if SUBSTR is not allowed.
Back to top
View user's profile Send private message
Alice

New User


Joined: 04 Jun 2009
Posts: 4
Location: India

PostPosted: Thu Jun 04, 2009 3:17 pm
Reply with quote

Tried with WHEN (SUBSTR(<Column Name>,m,n) LIKE '<value>')
It doesnt work.

The problem might be with the usage of SUBSTR in WHEN clause.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 3:21 pm
Reply with quote

glad you found your answer.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Jun 04, 2009 4:11 pm
Reply with quote

Alice,

This worked for me,
Code:
UNLOAD TABLESPACE BOBT1.EMPTS               
PUNCHDDN SYSPUNCH UNLDDN SYSREC             
FROM TABLE BOBT1.EMPLOYEE                   
(EMPNO, LASTNAME, SALARY DECIMAL EXTERNAL) 
WHEN (EMPNO LIKE ='1001%')     


Are you looking for something like this ?

Thank You,
Sushanth
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 04, 2009 4:14 pm
Reply with quote

I seem to recall that the WHEN clause only allowed basic comparisons and wouldn't let you do functions in the comparison such as SUSBTR etc. I'd have to dig out the documentation and check (or you could do that yourself).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts SCOPE PENDING option -check data DB2 2
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Multiple table unload using INZUTILB DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
Search our Forums:

Back to Top