|
|
| Author |
Message |
Bina reddy nalla
New User
Joined: 05 May 2008 Posts: 2 Location: hyderabad
|
|
|
|
Hi
how do we split a huge file(around 65000 recs) into smaller recs using
REXX
below is a program for only 8 recs in a file
| Code: |
...
"EXECIO * DISKR INPUT (FINIS STEM INARRAY."
P = 1
Q = 5
DO WHILE P <= 7
DO I=P TO Q
SAY INARRAY.I
QUEUE INARRAY.I
END
"EXECIO "QUEUED()" DISKW OUTPUT (FINIS"
P = P+3
Q = Q+3
END
|
thr is an error regd the allocation of output file,
we are not understanding how to put the split output into a separate output file.
thanks & Regards
bina |
|
| Back to top |
|
 |
References
|
Posted: Mon May 05, 2008 4:22 pm Post subject: Re: splitting a huge file into smaller ones using REXX |
 |
|
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1173 Location: germany
|
|
|
|
| Quote: |
thr is an error regd the allocation of output file,
|
well if it is error rex000199 then you have allocated a file on tape.
if the error is rex0001998 then you have to many do loops.
if the error is not one of the above, it might be helpful to see a trace and error list. otherwise, you will have to debug on your own. |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3014 Location: Charlotte,NC USA
|
|
|
|
1. Read a record. When EOF, close the input, the output, and exit.
2. Add 1 to the input record count.
3. If less than the split value, push record to the stack. Else, close the output, create a new stack, reset the input record count, then push the record to the stack, and assign a new DD to the output.
4. Write record to output.
5. Goto 1. |
|
| Back to top |
|
 |
Marso
Active User
Joined: 13 Mar 2006 Posts: 284 Location: Israel
|
|
|
|
1. If you want a relevant answer, you have to give all the information:
Do you want to split the file on a specific value in the record, or just by counting ?
2. In both case, you should consider using SORT. It will be faster than any REXX you can write. |
|
| Back to top |
|
 |
acevedo
Active User
Joined: 11 May 2005 Posts: 259 Location: Spain
|
|
|
|
| yes, IMHO Rexx is not the proper tool for this task, as Marso, I think you should try sort (dfsort, Syncsort...) they have specific options to split a file. |
|
| Back to top |
|
 |
Bina reddy nalla
New User
Joined: 05 May 2008 Posts: 2 Location: hyderabad
|
|
|
|
Thanks all
i wil try using syncSORT or dfSORT |
|
| Back to top |
|
 |
|
|