As a first step I tried to repeat REC2 for 5 times. I tried by using REPEAT keyword with INCLUDE COND
OPTION COPY
INCLUDE=(1,4,CH,EQ,'REC2')
REPEAT=5
I am able to repeat for desired number of times, but INCLUDE condition also filtering other records. So, My output file is missing other record types. (REC1, REC3,REC4,REC5). My output file is like this :
Thanks kolusu. I got the logic. But I have few problems.
1. My data file is VB.
2. 'Repeat' parameter is big. Say for example 20000
For the first one, I know that, I have to replace the positions. But, the second one is a big concern for me. I can't go for repeating BUILD statement multiple times.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Now, go back over what you originally posted and this latest "discovery" and meditate on why you could not be bothered to post this originally . . . You knew the number could be rather large.
Why should Kolusu spend more time on another solution that may be completely undone by a newer revelation . . .
Of course if you want this quickly, suggest you go ahead and write a tiny bit of code to do what you want. Then when the scope changes again, it will all be under your control.
why you could not be bothered to post this originally
Sorry for that. I thought my code will be improved by adding few controls which allows missing records also be written in the output file. So I am completely thinking about the missing records. I didnot bother about the repeat value, as it can be easily configured in code. (i.e. I can easily change repeat parameter value to desired result).
Let me make it clear
♦ Input file -> create large file -> Generate statement of 50 MB
♦ Main objective - After processing this output file, we should be able to generate a statement of 50MB
♦ Approach - only REC2 & REC4 can increase the size of the statement. Other records can not help for increasing the size. SO there will be no use to repeat other record types.
♦ Input file -> repeat REC2 & REC4 -> create big file -> Statement of 50MB.
So, I am not sure about the repeat parameter value. It can be greater than 20000+.
Can we able to multiply the repeating string in the BUILD control ?
Like
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
If you do the INCLUDE on OUTFIL with a named file, and a second OUTFIL with SAVE then in a seperate step MERGE the two.
Because the REPEAT is on OUTFIL I can't think of a way (other than the same DD on two OUTFILs, which I don't think will work) with only one pass of the data.
I can be wrong :-)
EDIT: I now notice that you say "merge with the original dataset" in your last. That would work as well, without having to write out the extra from the OUTFIL with SAVE. You could get the "exact" amount of records by coding the value of ( "desired repeated records in total" - one ) on the REPEAT= .
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
Nice to see you helping out.
However,
One COPY, REPEAT= being (value-desired minus one)
Then MERGE new file with original
Other than loosing flexibility, I'm never sure what the point is of using ICETOOL for this type of thing. "One step" "two steps" not enough difference to warrant making it more complex, to my mihd.