Page 1 of 1

Sorting a FB file

PostPosted: Thu Jul 02, 2009 5:14 pm
by ansh_4702
Hello,

My i/p file is having following records:
5
98
8
27
1
when we view this doing "hex-on" it shows trailing nulls after the actual values, like this:
5
F4444444444444
50000000000000
--------------
98
FF444444444444
98000000000000
--------------
8
F4444444444444
80000000000000
--------------
27
FF444444444444
27000000000000

when I am using following sort card for this to get the correct sorted data:
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=NONE
/*
From this I am getting o/p as,
1
27
5
8
98

Meaning it is considering the first value "1" as "10" and similarly for others. But I want this to not consider the trailing nulls (meaning consider it as "1" only). Could any one suggest anything on this sothat I could get the following output in the correct sort order that i want(the length of i/p file is 80 and same is of o/p):
1
5
8
27
98
Please help.

Re: Sorting a FB file

PostPosted: Thu Jul 02, 2009 11:11 pm
by dick scherrer
Hello,

There are no trailing nulls - an x'40' is a space. . .

In your sort statement, try UFF instead of CH.

Re: Sorting a FB file

PostPosted: Thu Jul 02, 2009 11:38 pm
by ansh_4702
Thanks so much Dick.....it worked !! I didnt knw abt this before....thanks again for your quick help on this.

Re: Sorting a FB file

PostPosted: Thu Jul 02, 2009 11:39 pm
by dick scherrer
You're welcome - thanks for letting us know it is working :)

d