Bteq Sort Vs SQL Assisstant

Tools
Enthusiast

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?

2 REPLIES
Junior Contributor

Re: Bteq Sort Vs SQL Assisstant

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;

Enthusiast

Re: Bteq Sort Vs SQL Assisstant

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