View previous topic :: View next topic
|
Author |
Message |
joseph murphy
New User
Joined: 24 Nov 2008 Posts: 17 Location: USA
|
|
|
|
Hi all,
I am doing performance tuening for SQL quries using syncsort,i have CASE like this,
COALESCE(
SUBSTR(
CASE(WHEN ZONE_ID IS NULL
THEN '00000000'
ELSE DIGITS(ZONE_ID)
END)1,8)
SUBSTR('00000000'),1,8)
Note:-
ZONE_ID is a Decimal(8,0),PD format
I have to do formatting in syncsort outrec,how to do it? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
joseph murphy,
You are already using DIGITS to format the ZONE_ID field. Still what formatting you need to do? |
|
Back to top |
|
|
joseph murphy
New User
Joined: 24 Nov 2008 Posts: 17 Location: USA
|
|
|
|
Arun,
I just want to make my question clear to you,I am doing Performance fix for Jobs(contains Sql Quries),The SELECT contains
COALESCE(
SUBSTR(
CASE(WHEN ZONE_ID IS NULL
THEN '00000000'
ELSE DIGITS(ZONE_ID)
END)1,8)
SUBSTR('00000000'),1,8)
Note:-
ZONE_ID is a Decimal(8,0),PD format
I want to know the replacement for CASE in syncsort,I tried with CHANGE,but it didnt work,
OUTREC=(1:3,5,CHANGE=(8,C'0000000000',C'00000000'),
NOMATCH=(3,5,PD,EDIT=(TTTTTTTT)) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Try IFTHEN / WHEN / OVERLAY. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
joseph murphy,
It would be better if you post the entire SQL. Also I am not sure whether you'll be able to handle the NULL CASE in sort. See what do you get in output for NULL fields. |
|
Back to top |
|
|
joseph murphy
New User
Joined: 24 Nov 2008 Posts: 17 Location: USA
|
|
|
|
How to specify Low-values(null)?
zone_id(decimal(8,0)) i.e length=5
how to specify this in outrec(Syncsort)? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
what do you get in output for NULL fields. |
I m not sure how it gets written into output without any OUTREC formatting. |
|
Back to top |
|
|
|