View previous topic :: View next topic
|
Author |
Message |
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Does DFSORT has any keyword by which it can stop copy records in output file, when the output file record count reached with specified record count.
I know my output file can contain at max 2 records based on the condition I put in the SORT. I want to stop processing once the record count reached in the output file, DFSORT need to stop processing of reading the whole file. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Perhaps the STOPAFT keyword is what you want ?
Garry. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
shrivatsa wrote: |
I know my output file can contain at max 2 records based on the condition I put in the SORT. |
You are certain of this? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
all depends on the layout/sorting status of the input file
since You do not tell how the two needed records are populated little can be said! |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Yes I know that there can be max 2 records can be for a key combination
for example I have below records as input file I know the key record 002133457 I need in the output file. For this Key there can be either P record or T record exists or both can exists. I want my my sort should stop reach after reading the key. i.e it should not read the key 002133458.
I don't have the information the record number on which the key exists in the example by looking it we can say that the 3rd record is the key. But from the file which I am copying the record I don't have the information.
Code: |
002133456 P IN
002133456 T CA
002133457 P WA
002133458 P RI
002133458 T AZ |
Please let me know if this is can be done in DFSORT?
Thanks for all your time spending to resolve the problem |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Your description of your requirement is very confusing. I really have no idea what you're actually trying to do.
All I can do is tell you a little about how STOPAFT works that may or may not be relevant.
DFSORT's STOPAFT=2 parameter can stop reading the input after 2 records are accepted. So for example, if you wanted to stop after finding 2 records with key '002133456', you could use:
Code: |
OPTION COPY,STOPAFT=2
INCLUDE COND=(1,9,CH,EQ,C'002133456')
|
But if you only have one 002133456 record, the entire file would have to be read looking for that second 002133456 record that isn't there. |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Thanks Frank that is what I required. I thought STOPAFT will stop after reading the specified number of records from the input file. |
|
Back to top |
|
|
|