IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to set End of file in rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Thu Aug 28, 2008 11:54 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 28, 2008 12:40 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 28, 2008 12:53 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Aug 28, 2008 3:43 pm
Reply with quote

I don't know. That's how I've always done it.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Aug 28, 2008 4:02 pm
Reply with quote

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
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Thu Aug 28, 2008 8:13 pm
Reply with quote

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
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Aug 28, 2008 8:30 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Aug 28, 2008 9:51 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 29, 2008 12:33 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 29, 2008 12:35 am
Reply with quote

Quote:
REXX may be the worst for reading a huge file. . . .
Perl is not far behind, then!
Back to top
View user's profile Send private message
malathy_tv

New User


Joined: 29 May 2007
Posts: 34
Location: chennai

PostPosted: Fri Aug 29, 2008 11:49 am
Reply with quote

hi,

Thanks for the ideas and the routines posted.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 29, 2008 12:25 pm
Reply with quote

LRECL of 32000

What type of record are you processing icon_eek.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top