Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Option of using DSNUTILB alone for unload

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Option of using DSNUTILB alone for unload
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    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 2:27 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 3:05 pm    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Jun 04, 2009 3:21 pm    Post subject:
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: 1013
Location: India

PostPosted: Thu Jun 04, 2009 4:11 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Jun 04, 2009 4:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us