View previous topic :: View next topic
|
Author |
Message |
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Hi,
I am unloading a table onto file using DSNUTILB.
I also use case statement in the SYSIN of the unload job
SELECT COL1,
COL2,
COL3,
CASE COL4
WHEN 'A' THEN 'APPLE'
WHEN 'B' THEN 'BALL'
END
FROM TABLE1
When the value of COL4 is 'C' I need verbiage to be 'APPLE'.
It is possible for me add 1 more statement to SYSIN as below,
WHEN 'C' THEN 'APPLE'
But by looking at SYSIN we would not be able to infer Easily that 'A' and 'C' have the same verbiage.
Is there any other way in which I can accomplish the same task?
I tried
WHEN 'A' OR 'C' THEN 'APPLE' in SYSIN.
But this is not working.
Help is much appreciated. |
|
Back to top |
|
|
Keanehelp
New User
Joined: 27 May 2008 Posts: 71 Location: USA, CA.
|
|
|
|
It is possible for me add 1 more statement to SYSIN as below,
WHEN 'C' THEN 'APPLE'
Have you tried this???? |
|
Back to top |
|
|
Elixir
Active User
Joined: 08 Feb 2009 Posts: 116 Location: CHENNAI/NEW JERSEY - INDIA/USA
|
|
|
|
Hi Keane,
The Syntax mentioned by you was tried by me earlier and was working.
SYSIN snippet would be as below,
WHEN 'A' THEN 'APPLE'
WHEN 'B' THEN ' '
WHEN 'C' THEN 'APPLE'
In this case 'A' and 'C' correpond to same Verbiage.
If there are many WHEN statements, then by looking at the SYSIN we would not be able to Make out easily the column values which correspond to same verbiage.
Is there any other format wherein by looking at SYSIN we can make out that these column values correspond to these verbiage.
I tried
WHEN 'A' OR 'C' THEN 'APPLE' in SYSIN,
this is not working.
Help appreicated. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
this is not working |
and won't. it is not valid sql syntax.
if you are worried about appearances, then:
WHEN 'A' THEN 'APPLE'
WHEN 'C' THEN 'APPLE'
WHEN 'B' THEN ' ' |
|
Back to top |
|
|
|