Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6966
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: 6966
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: 6966
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 BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm
No new posts DB2 Unload format options Susanta DB2 2 Fri Aug 12, 2016 5:42 pm
No new posts Compiler option for override the exte... muralikrishnan_new COBOL Programming 9 Fri Jul 08, 2016 12:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us