Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to set End of file in rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to set End of file in rexx
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: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 28, 2008 12:40 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Thu Aug 28, 2008 12:53 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Aug 28, 2008 3:43 pm    Post subject: Reply to: How to set End of file in rexx
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: 456
Location: Belgium

PostPosted: Thu Aug 28, 2008 4:02 pm    Post subject:
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    Post subject:
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: 456
Location: Belgium

PostPosted: Thu Aug 28, 2008 8:30 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Aug 28, 2008 9:51 pm    Post subject: Reply to: How to set End of file in rexx
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

Site Director


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

PostPosted: Fri Aug 29, 2008 12:33 am    Post subject:
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri Aug 29, 2008 12:35 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 29, 2008 12:25 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us