Article View: bit.listserv.asm370
Article #1601Re: VM/CMS Release 5 Assembler Program To Read Huge Files
From: KLASSEN
Date: Sat, 18 Jan 1992 21:10
Date: Sat, 18 Jan 1992 21:10
56 lines
3186 bytes
3186 bytes
In article <9201180109.AA05273@ucbvax.Berkeley.EDU> you write:
>
>1) Reads specific records from 1,000,000 record file(s). I would pass
> the line record number(s) that I wanted read as parameters to the
> program. It then puts these records into the console stack. (I know
> that this is basically an easy program to write, but I am busy with
> writing a larger application that needs two specific assembler files,
> and I would really like a 'gift' from the network instead of having
> to write my own from scratch.)
It will be only slightly slower to use the basic facilities
which CMS already provides, e.g., VM/SP System Product Interpreter
and native CMS commands, i.e.,
/* REXX, of course */
/* Usage: 'READIT' record numbers are placed here,
e.g., 'READIT 1 33 555 7777 99999'
Resulting records are placed into the stack */
arg parameters
file = 'HUGE FILE A'
address command
do while (parameters <> '')
parse var parameters token parameters
'EXECIO 1 DISKR' file token
if rc = 0 then iterate
say 'Unexpected return code' rc 'when attempting to read record' token
leave
end
t=rc
'FINIS' file
exit t
>
>2) Write a three byte binary value to a file. It increments this value
> by one and then writes it to the file (along with some other data).
> The record layout looks like "AAABBBBBBBB", where "AAA" is the
> binary field, and "BBBBBBB" is the other field. "AAA" starts at '1'
> and is incremented up to about 1,000,000.
/* REXX, again */
address command
arg integer other_field
RECORD = d2c(integer+1,3) || other_field
file = 'TEST FILE A'
'EXECIO 1 DISKW' file '( VAR RECORD'
exit rc
Note that this code writes the new record to the "end" of the CMS file,
and that, for efficiency sake, does ***NOT*** issue "'FINIS' file".
This is left as a responsibility of the problem which calls this EXEC file,
i.e., to take a check-point every "N" records.
> (think of doing an XEDIT search on "/DOCTORS" in a 1,000,000
>record 200 byte CMS file versus the same search on a 15 byte file)
>
Actually, XEDIT uses the translate-and-test (TRT) instruction to search
each record for the first character of the search-string, e.g., 'D'.
Thus, one machine-language instruction will very quickly eliminate
the need to intensively-search many of the record, or it will give
a suitable column-pointer for the start of an intensive search.
Technical Details
Message-ID:
<9201182110.AA18893@sol.UVic.CA>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!paladin.american.edu!auvm!UVSOL.BITNET!KLASSENShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcdcb,580c0c1581978f7c X-Google-Attributes: gidfcdcb,public X-Google-ArrivalTime: 1992-01-18 13:25:45 PST Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!paladin.american.edu!auvm!UVSOL.BITNET!KLASSEN Organization: University of Victoria, Victoria, B.C. CANADA Message-ID: <9201182110.AA18893@sol.UVic.CA> Newsgroups: bit.listserv.asm370 Date: Sat, 18 Jan 1992 13:10:24 PST Sender: IBM 370 Assembly Programming Discussion List <ASM370@UGA.BITNET> From: KLASSEN@UVSOL.BITNET Subject: Re: VM/CMS Release 5 Assembler Program To Read Huge Files