View previous topic :: View next topic
|
Author |
Message |
malathy_tv
New User
Joined: 29 May 2007 Posts: 34 Location: chennai
|
|
|
|
hi,
i need to read a file and process each records based on certain conditions
am reading them into a stem varible and process it, the problem is when the file is of huge volume i.e when the file automatically goes into the browse mode it abends and am not able to process it
so i thought of reading 5000 records at time process it ,write to the output and then again process for 5001 record to 10000 write to the output and so on till the end of the input file
"EXECIO 5000 DISKR INPDD (STEM INP. FINIS"
but am not sure how to set the end of file and increase the input file to read from 5001 to 10000 snd so on
suggestions please. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
This has already been posted on the forum. Here is a simple example.
Code: |
"EXECIO 0 DISKR DCO (OPEN)"
EOF = 0
DO FOREVER UNTIL(EOF)
"EXECIO 25000 DISKR DCO (STEM DCOI."
IF RC <> 0 THEN EOF = 1
DO A = 1 TO DCOI.0
*** PUT PROCESSING CODE HERE ***
END
END
"EXECIO 0 DISKR DCO (CLOSE)"
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I'm no REXX expert, but why is there such a fascination to read the records into a stem variable, why not just read 1 record at a time like most other languages .
Gerry |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't know. That's how I've always done it. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Quote: |
when the file automatically goes into the browse mode it abends and am not able to process it
|
Does this mean that the process is online?
So turn to batch, with one truth in your head : REXX is not the best for IO, for reading huge file. You have to know that.
Cheers
Pierre |
|
Back to top |
|
|
malathy_tv
New User
Joined: 29 May 2007 Posts: 34 Location: chennai
|
|
|
|
the process is done in the batch mode using the following jcl
//REXXRUN JOB (8200,7556),'TEST JCL',REGION=0M,
// NOTIFY=&SYSUID,MSGCLASS=J,MSGLEVEL=1,1),CLASS=O,PRTY=4
//REXX1 EXEC PGM=IKJEFT01
//SYSEXEC DD DISP=SHR,DSN=TZXXX01.REXX.SOURCE
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSTSIN DD *
%FMT3
But then its getting abended S322 time out after riting few records as the lrecl of the outfile is 32000 its not able to write many records |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
So ( don't speak of "browse mode" ) your job has exceeded the time allowed.
I repeat REXX is not the correct solution to handle huge file.
Turn to PL/I or Cobol.
regards
Pierre |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Regardless of the language used, a large file takes a long time to read and to write to another file.
I think you need to specify a much longer time on your job card or perhaps use a different job class.
But even if the current job time limit is just a few seconds, you should get more than a few records. Perhaps you are getting into a loop and do not realize it. Add a trace to your program. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
REXX is not the best for IO, for reading huge file. |
To echo what Pierre says, but a bit stronger. . .
REXX may be the worst for reading a huge file. . . . |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
REXX may be the worst for reading a huge file. . . .
|
Perl is not far behind, then! |
|
Back to top |
|
|
malathy_tv
New User
Joined: 29 May 2007 Posts: 34 Location: chennai
|
|
|
|
hi,
Thanks for the ideas and the routines posted. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
LRECL of 32000
What type of record are you processing |
|
Back to top |
|
|
|