Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1. Counting records 2. Wait

Status
Not open for further replies.

tpms2000

Programmer
Jan 20, 2003
19
0
0
EU
1. How to count the number of records in a file ?
a) EXECIO * DISKR etc falls over at about 250,000 whether it's put on the stack or in a stem.
b) If it's a PDS (or I copy it to a PDS) the stats only show a maximum of 65536 even if there's more than that in the file.
2. How to wait a few seconds without tying up CPU. I don't know Assembler or Unix. There was an earlier discussion on this but it did not work for me.
 
I have tried to find it too, but found no dircct way to do this.
The only ways I figured out were

Allocate files for sorting the file
Call Sort from within the REXX to copy the file
Read the the SYSOUT file, there is a line giving number of records,
e.g. "ICE090I 0 OUTPUT LRECL = 125, BLKSIZE = 27998, TYPE = VBA
"ICE055I 0 INSERT 0, DELETE 0"
"ICE054I 0 RECORDS - IN: 40, OUT: 40 "
or
read the information there is using LISTDSI and see what what
space you are using and calculate how many records there could be.

Uffe

 
1) a possible way of counting records in a file too large for REXX to read is to read in 200k records, see if you got the whole 200k, and if you did, read another 200k, and if you didn't then add the total read up.

Something like;
"Alloc Fi(IN) Da('my.data.set') Shr Reu"
Recs = 0
Finished = 0
Spos = 1
"NEWSTACK"
do until finished
"Execio 200000 DiskR IN "Spos" (Finis)"
Recs = Recs + queued()
if queued() < 200000 then Finished = 1
else Spos = Spos + 200000
&quot;DELSTACK&quot;
end
&quot;Free Fi(IN)&quot;
say 'Total records is 'Recs


It's pretty brutal I suppose. [yinyang]

2) most mainframe sites I have worked at have had a program which already does this, or someone with the skills to write a program which is callable and a time parameter passable. I suggest you ask a Sysprog - and there must be an Assembler forum?
 
Counting: one of the programmers here uses SYNCSORT to copy one byte from each record into a VIO output file, then summarizes it somehow to deliver a record count. I don't have all the details, but it was pretty fast for large files.

Waiting: You can only do this in Assembler. Don't even think about it otherwise; it's not going to happen.



Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Many thanks for your replies - much appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top