Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sorting a hexadecimal field.

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

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:24 pm    Post subject: Sorting a hexadecimal field.
Reply with quote

hi,

I have a hexadecimal field in my input file. I want to sort that file in that field in acending order. Can anyone help me in doing this? What type of format i have to use? I have only SYNCSORT in my shop.

I tried to sort the file with the format F, but it doesn't come correctly.

    AF
    A0
    A0
    A2
    BJ
    BM
    B8
    CA
    CH
    C1
    C4
    C4
    C5
    C5



Thanks,
Bala
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:37 pm    Post subject:
Reply with quote

As far as it goes, there is no such thing as a hexadecimal field.
That said, "format F"?
Treat the two columns as character and it will sort just fine.
What order do you want vs what order did you get?
What do your sort control parms look like?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:42 pm    Post subject:
Reply with quote

hi,

My sort card looks like this.

Code:
SORT FIELDS=(21,10,CH,A)


I want the output like the following

A0
A0
A2
AF
B8
BJ
BM
C1
C4
C4
C5
C5
CA
CH

Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:49 pm    Post subject:
Reply with quote

A2
AF

B8
BJ

C5
CA

So for all 10 columns you want numerics to sort ahead of alphabetics?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:50 pm    Post subject:
Reply with quote

yes
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:58 pm    Post subject:
Reply with quote

Again, did you look in the manual?

Chapter 2. SyncSort Control Statements
Sample ALTSEQ Control Statements
ALTSEQ CODE=(F0B7,F1B8,F2B9,F3BA,F4BB,F5BC,F6BD,F7BE,F8BF,F9C0)
Figure 7. Sample ALTSEQ Control Statement
This sample ALTSEQ control statement shows that the numbers 0 through 9 are to collate
before the uppercase alphabet.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 5:09 pm    Post subject:
Reply with quote

Hi William,

Yes I have the manual and I looked into that. But the thing is how can i find the corresponding hex code for alphabets and digits? And i haven't ever used the ALTSEQ, a little bit hesistance as i am not aware of it. Could you help me how to find the hex code for alphabets and digits?
Thanks for your valuable information.

Thanks,
Bala
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 5:20 pm    Post subject:
Reply with quote

The posted example is exactly what you want:
"numbers 0 through 9 are to collate before the uppercase alphabet".
Just include it and you will get what you want.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 5:32 pm    Post subject:
Reply with quote

ok. Thanks William.

Thanks,
Bala
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: Mon Jun 04, 2007 7:16 pm    Post subject:
Reply with quote

Hello,

While on the pc and unix systems, it is "normal" for numbers to sort ahead of letters. This is not true on the mainframe.

While you can force the sequence you want, you may have problems using it in your application programs. Anything that compares one value to another will compare the numbers as a higher value than the letters eventhought they are presented "out of order". Any "keys" in vsam or database will use the standard collating sequence, not the "ALTSEQ".

If the only reason for this sequence to is to download, you may be ok, but if the ALTSEQed output is to be used on the mainframe, there may be problems.
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us