MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syncsort Include condition

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Prayank
Beginner


Joined: 13 May 2003
Posts: 18
Topics: 9
Location: Indore,India

PostPosted: Mon Oct 13, 2003 4:33 am    Post subject: Syncsort Include condition Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Mon Oct 13, 2003 4:41 am    Post subject: Reply with quote

Prayank,

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

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Oct 13, 2003 8:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Oct 13, 2003 9:56 am    Post subject: Reply with quote

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.
_________________
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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Mon Oct 13, 2003 10:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Mon Oct 13, 2003 11:32 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Prayank
Beginner


Joined: 13 May 2003
Posts: 18
Topics: 9
Location: Indore,India

PostPosted: Wed Oct 15, 2003 5:24 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Wed Oct 15, 2003 6:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Oct 15, 2003 7:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group