All Forums Tools
Karthikeyan_dsk 5 posts Joined 11/13
22 Jul 2015
Bteq Sort Vs SQL Assisstant

Hi,
I am trying to find min and max in below list of values

U
05
04
03
01
00

 

My intended result is Min = '00' and Max = 'U' which is same from SQL Assisstant. But when i do the same in BTEQ (via Mainframe) it is considering Character values as minimum and result is not as per my expectation. I have two questions 1. Why this difference between SQL Assisstant (Mine is 14.1) and BTEQ 2. It might be that BTEQ is the reliable one. But I want U to be retuned as maximum value and 00 as Min. Is there a way?

dnoeth 4628 posts Joined 11/04
22 Jul 2015

This is probably due to different collations, Mainframe might use EBCDIC.
Check the collation returned by HELP SESSION; in BTEQ and use this instead, e.g. SET SESSION COLLATION ASCII;

Dieter

Karthikeyan_dsk 5 posts Joined 11/13
28 Jul 2015

Thank you :) that works.. and yes the Mainframe uses EBCDIC

You must sign in to leave a comment.