Article View: bit.listserv.xedit-l
Article #52(no subject given)
From: Paul Russell
Date: Tue, 06 Oct 1992 14:20
Date: Tue, 06 Oct 1992 14:20
51 lines
2506 bytes
2506 bytes
If you have CMS PIPELINES, this should be fairly easy to do with PIPES.
(I don't have PIPES, so I won't try to pretend to know how to do this.)
If you don't have PIPES, you could use a short REXX program to read the
existing file with EXECIO, put the lines together, and write a new file
with EXECIO. (Oh, no! EXECIO!) The structure of the data in the input
file will dictate the logic required to put the lines back together. If
the input data includes continuation characters in some fixed position
(usually the last) of each record, you could use the presence/absence of
the continuation character to determine whether to continue building the
current output record or to start a new output record. If, on the other
hand, each full record has been broken into a fixed number of shorter
records, you could use a simple iterative loop to create an output record
for every x input records. Some quick and dirty, untested, simple REXX
examples follow:
/* For example only - may contain syntax and/or logic errors */
infile = 'INPUT DATA *'
outfile = 'OUTPUT DATA A'
outlrecl = 930
'EXECIO * DISKR' infile '0 (FINIS STEM IN.'
if rc <> 0 then exit rc
out. = '' ; out.0 = 0
call BUILD_OUTPUT
if out.0 > 0 then
'EXECIO' out.0 'DISKW' outfile '0 F' outlrecl '(FINIS STEM OUT.'
exit rc
/* Subroutine to build output if input has continuation characters */
BUILD_OUTPUT: procedure expose in. out.
cont_char = 'X'
count = 1
do n = 1 to in.n
if substr(in.n,length(in.n),1) = cont_char then
out.count = out.count || substr(in.n,1,length(in.n)-1)
else
do
out.count = out.count || in.n
out.0 = count ; count = count + 1
end
end
return
/* Subroutine to build output from fixed number of input records */
BUILD_OUTPUT: procedure expose in. out.
count = 1 ; infix = 4
do n = 1 to in.n
out.count = out.count || in.n
if count // infix = 0 then
do
out.0 = count ; count = count + 1
end
end
return
Technical Details
Message-ID:
<XEDIT-L%92100611151351@UGA.CC.UGA.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!IUBVM.BITNET!PRUSSELLShow Full Headers
Complete Article Headers
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Subject: (no subject given) Path: arc1-ca.pugleaf.net!sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!IUBVM.BITNET!PRUSSELL Message-ID: <XEDIT-L%92100611151351@UGA.CC.UGA.EDU> Newsgroups: bit.listserv.xedit-l Date: Tue, 6 Oct 1992 09:20:58 EST Sender: VM System Editor List <XEDIT-L@UGA.BITNET> From: Paul Russell <PRUSSELL@IUBVM.BITNET> In-Reply-To: Message of Mon, 5 Oct 1992 11:31:59 CDT from <SSQLBC@UIUCVMD> Lines: 51