Syncsort Include condition
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: Syncsort Include condition Author: PrayankLocation: Indore,India PostPosted: Mon Oct 13, 2003 4:33 am
    —
Lets say I have following sort include condition:

SORT FIELDS=COPY
INCLUDE COND=(9,5,CH,EQ,C'12345')

I want that the execution of this step terminates the moment one record satisfying this condition is found (There will be only one record satisfying this condition in the input dataset. My input dataset is a VSAM KSDS). Is it possible to acheive this ?

#2:  Author: kolusuLocation: San Jose PostPosted: Mon Oct 13, 2003 4:41 am
    —
Prayank,

No. But if you know the record-no then you can use STOPAFT parameter.

kolusu

#3:  Author: coolmanLocation: US PostPosted: Mon Oct 13, 2003 8:02 am
    —
Prayank,
As Kolusu had stated it is possible with SORT but not very straightforward. However if you fileaid you can use this :

Code:

//STEP1    EXEC PGM=FILEAID               
//DD01     DD  DISP=SHR,DSN=YOUR.VSAM.KSDS                           
//DD01O    DD  SYSOUT=*                   
//SYSPRINT DD  SYSOUT=*                   
//SYSIN    DD  *                           
$$DD01 COPY IF=(9,EQ,C'12345'),OUT=1       
/*                                         
//                                         


Hope this helps...

Cheers,
Coolman
________
Honda CB-1 history


Last edited by coolman on Sat Feb 05, 2011 1:31 am; edited 1 time in total

#4:  Author: Frank YaegerLocation: San Jose PostPosted: Mon Oct 13, 2003 9:56 am
    —
Kolosu,

Unless STOPAFT works differently for Syncsort than for DFSORT (which I doubt), your response is incorrect (perhaps you were thinking of ENDREC rather than STOPAFT?). STOPAFT=1 will do what Prayank asked for. STOPAFT=n says to stop after n records have been accepted for sorting or copying.

Here's a DFSORT job that will do what Prayank wants:

Code:

//S1    EXEC  PGM=ICEMAN             
//SYSOUT    DD  SYSOUT=*             
//SORTIN DD *                         
        AAAAA                         
        BBBBB                         
        12345                         
        CCCCC                         
        DDDDD                         
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD    *                   
  SORT FIELDS=COPY,STOPAFT=1           
  INCLUDE COND=(9,5,CH,EQ,C'12345')   


The SORTOUT output is:

Code:

        12345


The relevent DFSORT messages are:

Code:

ICE055I 0 INSERT 0, DELETE 2     
ICE054I 0 RECORDS - IN: 3, OUT: 1


Note that DFSORT stopped processing after the third record which is the first record accepted for copying by the INCLUDE statement.

Coolman,

As you can see, it's just as "straightforward" with SORT using STOPAFT as it is with FileAid.

#5:  Author: kolusuLocation: San Jose PostPosted: Mon Oct 13, 2003 10:20 am
    —
Frank,

I am mistaken Sad You are absolutely correct. Thanks for correcting me.May be it is too early in the morning(5:41 am) that my brain cells are still sleeping while I am answering the questions.

Kolusu

#6:  Author: coolmanLocation: US PostPosted: Mon Oct 13, 2003 11:32 pm
    —
Frank,

Got confused between STOPAFT and ENDREC. Yep, SORT is really "straightforward". I agree with you. Mr. Green

Coolman.
________
weed vaporizers


Last edited by coolman on Sat Feb 05, 2011 1:31 am; edited 1 time in total

#7:  Author: PrayankLocation: Indore,India PostPosted: Wed Oct 15, 2003 5:24 am
    —
Thanks everyone for your replies. It helped me a lot.

I have another query which is an extension to the previous one.

Can I code this as
SORT FIELDS=COPY,STOPAFT=(9,5,CH,GT,C'12345')
INCLUDE COND=(9,5,CH,EQ,C'12345')

OR Is there any other method to stop once a condition is satisfied ?

PRAYank

#8:  Author: kolusuLocation: San Jose PostPosted: Wed Oct 15, 2003 6:59 am
    —
Pryank,

The only parameter that STOPAFT accepts is 'N' i.e STOPAFT=N

'N' should be an absolute number. STOPAFT=N causes sort to stop after 'n' records in the input file have been sorted or copied.

You can change the value of 'n' to the no: of records you want to copy

Code:

 SORT FIELDS=COPY,STOPAFT=N
 INCLUDE COND=(9,5,CH,EQ,C'12345')


Hope this helps...

cheers

kolusu

#9:  Author: coolmanLocation: US PostPosted: Wed Oct 15, 2003 7:19 am
    —
Prayank,
Whatever you have coded is not correct. STOPAFT tells you how many records have to be accepted for SORTING/MERGING.

STOPAFT=N, where N is an integer


Hope this helps...

Cheers,
Coolman.
________
Subaru Forester specifications



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group