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.
Sorting a FB file
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Sorting a FB file
Hello,
There are no trailing nulls - an x'40' is a space. . .
In your sort statement, try UFF instead of CH.
There are no trailing nulls - an x'40' is a space. . .
In your sort statement, try UFF instead of CH.
Hope this helps,
d.sch.
d.sch.
Re: Sorting a FB file
Thanks so much Dick.....it worked !! I didnt knw abt this before....thanks again for your quick help on this.
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Sorting a FB file
You're welcome - thanks for letting us know it is working
d

d
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Can i read output file created after SORTing in the same pgm
by savitha_y » Sat Feb 06, 2021 1:17 am » in IBM Cobol - 4
- 1615
-
by savitha_y
View the latest post
Tue Feb 09, 2021 7:11 pm
-
-
-
EZIOE004 Logical I/O error on file occurred reading VB file
by savitha_y » Mon Feb 15, 2021 7:54 pm » in CA-Easytrieve - 3
- 4958
-
by savitha_y
View the latest post
Wed Feb 17, 2021 5:02 am
-
-
-
File Handling 3 input files and 1 output file by using EZT
by pavan426 » Thu Sep 09, 2021 12:17 am » in CA-Easytrieve - 0
- 4421
-
by pavan426
View the latest post
Thu Sep 09, 2021 12:17 am
-
-
-
Need to check whether file is ESDS file or not by using REXX
by Devrana » Sat Oct 05, 2024 2:28 pm » in CLIST & REXX - 6
- 3164
-
by sergeyken
View the latest post
Tue Oct 08, 2024 5:25 pm
-
-
- 6
- 2499
-
by MFDEV
View the latest post
Fri Sep 11, 2020 9:04 am