Need Help with a DFSORT issue



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need Help with a DFSORT issue

Postby zxdalma » Tue Oct 06, 2015 9:56 pm

Hello all,

Let us have the following control statement :

SORT FIELDS=(1,10,CH,A,26,4,CH,A,23,2,CH,A,20,2,CH,A,
             36,4,CH,A,33,2,CH,A,30,2,CH,A,    --> here is where I have the problem     
             11,2,CH,A,13,2,CH,A,40,1,CH,A)         
OPTION DYNALLOC 


I'd like to know if is is possible to do this sort altering the collating sequence ONLY for some of the positions of the file. These positions are : 36,4,CH,A,33,2,CH,A,30,2,CH,A.

What I need is to do the sort in such a way that character SPACES X'40' is higher than any other alphanumeric character only for fields 36,4,CH,A,33,2,CH,A,30,2,CH,A.

Example :

Input Sample File is :

038555168SITMC     24/04/200702/05/20072
038555168SITMC     08/05/200701/06/20076
038555168SITMC     08/05/2007                  2
038555168SITMC     10/09/200729/11/20072


Output file now I have is :

038555168SITMC     24/04/200702/05/20072
038555168SITMC     08/05/2007                  2
038555168SITMC     08/05/200701/06/20076
038555168SITMC     10/09/200729/11/20072


What I need is :
038555168SITMC     24/04/200702/05/20072
038555168SITMC     08/05/200701/06/20076
038555168SITMC     08/05/2007                  2
038555168SITMC     10/09/200729/11/20072


Code'd
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help with a DFSORT issue

Postby BillyBoyo » Tue Oct 06, 2015 10:34 pm

Locate Altering EBCDIC Collating Sequence—Examples in the DFSORT Application Programming Guide and look at Example 1

 SORT FIELDS=(18,20,AQ,A)
 ALTSEQ CODE=(5BEA)

The character $ (X'5B') is to collate at position X'EA', that is, after uppercase Z
(X'E9').


You should easily be able to arrange what you want from that.

You show your output in the same order as the input. Do you really need to SORT anyway?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need Help with a DFSORT issue

Postby zxdalma » Tue Oct 06, 2015 10:51 pm

Thanks for your quick reply.

Yes I do need to SORT; the file excerpts were only shown to make someone understand the problem I'm facing.

I've also consulted DFSORT Application Programming Guiide; and example 1 does not suit my needs; the question I'm posing is altering the collating sequence for ONLY SOME of the SORT arguments without affecting the others.

Is this possible?.
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help with a DFSORT issue

Postby BillyBoyo » Tue Oct 06, 2015 11:06 pm

Humour me, and try it before dismissing it. Change only the fields you want affected from CH to AQ.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need Help with a DFSORT issue

Postby zxdalma » Tue Oct 06, 2015 11:22 pm

Hello again, I've tried changing field from CH to AQ and it does not work¡¡¡. As with EBCBIC, in ASCII a blank is lower than any alphanumeric character¡¡; I need the other way round.
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help with a DFSORT issue

Postby BillyBoyo » Wed Oct 07, 2015 1:31 am

Show the code you have tried please. ASCII has nothing directly to do with anything I've mentioned.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need Help with a DFSORT issue

Postby zxdalma » Wed Oct 07, 2015 3:17 am

The SYSIN I've tried is as follows :

SORT FIELDS=(1,10,CH,A,26,4,CH,A,23,2,CH,A,20,2,CH,A,
36,4,AQ,A,33,2,AQ,A,30,2,AQ,A,
11,2,CH,A,13,2,CH,A,40,1,CH,A)
OPTION DYNALLOC

Note I've changed the affected fields treatment from CH to AQ.
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help with a DFSORT issue

Postby Akatsukami » Wed Oct 07, 2015 4:04 am

Well, since you neglected -- against Mr. Boyo's explicit recommendation -- to specify ALTSEQ, your failure isn't surprising.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Need Help with a DFSORT issue

Postby BillyBoyo » Wed Oct 07, 2015 8:35 am

Yes, the example included the ALTSEQ, and the description tells you want it does.

 ALTSEQ CODE=(40FA)


That should sort space (X'40') as higher than the number nine (X'F9') which is what you want, yes? It will only affect fields defined as AQ, you your CH fields are unaffected. Look at OPTION CHALT while you are at it, if you wanted to affect all SORT/MERGE fields without changing from CH.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Need Help with a DFSORT issue

Postby zxdalma » Wed Oct 07, 2015 6:24 pm

Thanks to BillyBoyo I've solved this issue.

The DFSORT SYSIN is as follows :

SORT FIELDS=(1,10,CH,A,26,4,CH,A,23,2,CH,A,20,2,CH,A,
36,4,AQ,A,33,2,AQ,A,30,2,AQ,A,
11,2,CH,A,13,2,CH,A,40,1,CH,A)
ALTSEQ CODE=(40F9)
OPTION NOCHALT DYNALLOC

Use NOCHALT option to override standard installation defaults in case these were set to CHALT=Y.
zxdalma
 
Posts: 13
Joined: Tue Oct 06, 2015 9:39 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post