View previous topic :: View next topic |
Author |
Message |
Prayank Beginner
![](images/avatars/gallery/startrek/tv165.gif)
Joined: 13 May 2003 Posts: 18 Topics: 9 Location: Indore,India
|
Posted: Mon Oct 13, 2003 4:33 am Post subject: Syncsort Include condition |
|
|
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 ? |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Mon Oct 13, 2003 4:41 am Post subject: |
|
|
Prayank,
No. But if you know the record-no then you can use STOPAFT parameter.
kolusu |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Oct 13, 2003 8:02 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Frank Yaeger Sort Forum Moderator
![Sort Forum Moderator Sort Forum Moderator](images/ranks/profrat.jpg)
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Oct 13, 2003 9:56 am Post subject: |
|
|
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:
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. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Mon Oct 13, 2003 10:20 am Post subject: |
|
|
Frank,
I am mistaken 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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Mon Oct 13, 2003 11:32 pm Post subject: |
|
|
Frank,
Got confused between STOPAFT and ENDREC. Yep, SORT is really "straightforward". I agree with you.
Coolman.
________
weed vaporizers
Last edited by coolman on Sat Feb 05, 2011 1:31 am; edited 1 time in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Prayank Beginner
![](images/avatars/gallery/startrek/tv165.gif)
Joined: 13 May 2003 Posts: 18 Topics: 9 Location: Indore,India
|
Posted: Wed Oct 15, 2003 5:24 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
kolusu Site Admin
![Site Admin Site Admin](images/ranks/adminpic.jpg)
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Wed Oct 15, 2003 6:59 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Wed Oct 15, 2003 7:19 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|