Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
Can any one tell how can i copy selected number of records from particular record value(not the row number of record value) .. for example.
I don't understand what you mean by this or how it relates to your example. Krisprems assumed you just wanted to select records with particular values, but that doesn't seem to match this description.
If Krisprems hasn't guessed right, then you need to explain more clearly the rules for getting from input to output and how they apply to the example you showed.
I thankful for you all to give your precious time.
Hi Frank,
May be my examples leads Krisprems to a wrong direction. May be I have to describe the problem in more clear manner. Here it is...
Say suppose a file consist of 1 million entries with no duplicates. I want to put 20000 sequential entries from this file to a new file, starting from the entry whose value matches with <XXXXXX>. So from this point of entry i want to copy the next 19999 entries into a output file. For example....
...........
...........
...........
...........
...........
...........
xxxxxxx ( Do not know the exact line number of xxxxxx entry)
300000 The next 19999 entries starting from the entry value (xxxxxxx) to be in my output file...
452345
674567
467567
454546
...........
...........
...........
...........
...........
...........
Output;
xxxxxxx
300000
452345
674567
467567
454546 plus the remaing entries until the count is 20000 ....
Since i donot know the row value of xxxxxxx, i am unable to use STARTREC in the sort input paramets.
I hope this will give more insight into my problem.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Krisprems is on the right track, but his solution gives one too many records and is a bit "off" in other ways. Here's a correct DFSORT/ICETOOL job. I assumed the input file has RECFM=FB and LRECL=80, but the job can be changed for other attributes.