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
 

 

How to do CASE statements in syncsort?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Fri Dec 12, 2008 2:21 pm    Post subject: How to do CASE statements in syncsort?
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2237
Location: @my desk

PostPosted: Fri Dec 12, 2008 6:21 pm    Post subject:
Reply with quote

joseph murphy,

You are already using DIGITS to format the ZONE_ID field. Still what formatting you need to do?
Back to top
View user's profile Send private message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Fri Dec 12, 2008 10:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Dec 12, 2008 10:43 pm    Post subject:
Reply with quote

Hello,

Try IFTHEN / WHEN / OVERLAY.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2237
Location: @my desk

PostPosted: Sat Dec 13, 2008 12:23 am    Post subject:
Reply with quote

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
View user's profile Send private message
joseph murphy

New User


Joined: 24 Nov 2008
Posts: 17
Location: USA

PostPosted: Mon Dec 15, 2008 10:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2237
Location: @my desk

PostPosted: Mon Dec 15, 2008 11:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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