Page 1 of 1

can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 12:02 pm
by arya_starc
Hi all,

As I need to add include condition in sort, as these are in same position. can I add in single line
below is my sort
 SORT FIELDS=(41,19,ZD,A,74,4,PD,A,132,6,ZD,A)                    
  INCLUDE COND=((343,4,CH,EQ,C'DITM'),OR,(343,4,CH,EQ,C'DINP'),OR,
                (343,4,CH,EQ,C'DINR'),OR,(343,4,CH,EQ,C'RLWO'),OR,
                (343,4,CH,EQ,C'RLWI'),OR,(343,4,CH,EQ,C'RLFR'),OR,
                (343,4,CH,EQ,C'RLWA'),OR,(343,4,CH,EQ,C'RLWC'),OR,
                (343,4,CH,EQ,C'RLMC'),OR,(343,4,CH,EQ,C'RDWC'),OR,
                (343,4,CH,EQ,C'RDWI'),OR,(343,4,CH,EQ,C'EPWO'),OR,
                (343,4,CH,EQ,C'EPWC'),OR,(343,4,CH,EQ,C'SMWO'))
 

Re: can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 2:41 pm
by NicC
Nothing to do with COBOL - topic moved.

I am not sure what you are asking/meaning! Give an example - not just words.

What have you tried? What happened - apart from "it did not work"?

Re: can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 6:45 pm
by ottoelflaco

Re: can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 8:06 pm
by Robert Sample
You have not clearly identified what you want instead of the code you posted.

I suspect what you want to know is in the DFSORT Application Programming Guide in the Substring Comparison Tests under the INCLUDE control statement:manual:
2.Find a field value within a constant. For example, you can search the character constant C'J69,L92,J82' for the value in a 3-byte field. If the field value is C'J69', C'L92', or C'J82', the relational condition is true; if the field value is C'X24', the relational condition is false. Note that the comma is used within the constant to separate the valid 3-character values; any character that will not appear in the field value can be used as a separator in the constant.

Re: can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 9:48 pm
by BillyBoyo
I would also guess the same way as Robert.

Also note that it does not matter the order you specify the Control Statements, they will be processed in the order specified by SORT. No matter what you think from what you have specified, the INCLUDE will be processed before the SORT. It doesn't matter in your example, because there is no expected relationship between the two statements, but if you tried to write OUTREC before SORT, for instance, you won't get what you expect.

Re: can i use in one line of that sort

PostPosted: Thu Sep 15, 2016 11:23 pm
by enrico-sorichetti
INCLUDE COND=((343,4,CH,EQ,C'DITM'),OR,(343,4,CH,EQ,C'DINP'),OR,


my guess is that the TS wants to know if the condition can be written as something like

INCLUDE COND=(343,4,CH,EQ,C'DITM',OR,C'DINP',OR,....,OR,....

Re: can i use in one line of that sort

PostPosted: Tue Sep 20, 2016 1:27 pm
by pranav283
Contents deleted as it did nothing except plagiarise Enrico's post and did not do it nearly as well - partly because the code tags were not used.