Re: Set a file variable to another
- From: "HeyBub" <heybubNOSPAM@xxxxxxxxx>
- Date: Mon, 23 Oct 2006 19:05:57 -0500
Frederico Fonseca wrote:
On Mon, 23 Oct 2006 09:14:40 -0500, "HeyBub" <heybubNOSPAM@xxxxxxxxx>Well, sure. Since the OP wanted to read "several input files," I presumed
wrote:
Apokrif wrote:this only works if the files have the same structure.
Hi,
in C you can say:
FILE *current, *g;
current=g;
Or in Pascal:
var current,g:^text;
begin
f=g;
end;
This is, for instance, if you want to read several input files
(g,h...) but only perform the fgets or readln operations
on a single "current" file variable (for some reason, calls to fgets
or readln are in a part of the source code you cannot change, or
don't want to change so that you have a generic reading operation).
I'd like to know how to do it in Cobol: would
fd foo.
fd bar.
and then:
move foo too bar
be correct ?
"too" is a C command?
A COBOL program can use the same procedure to read multiple physical
files. Typically:
SELECT Input-File assign to DATA-NAME (this construct varies by
compiler)
MOVE "INPUT-A" to DATA-NAME
PERFORM Read-Input
MOVE "INPUT-B" to DATA-NAME
PERFORM Read-Input
etc.
Read-Input
OPEN Input Input-File
Read Input-File
PERFORM UNTIL Input-FS not = '00'
(process input record)
READ Input-file
END-PERFORM
CLOSE Input-File.
e.g. if they are indexed they MUST have the same record size, and
exactly the same keys on the same order and same definition.
the input files were physically identical.
Then, again, his motive may have been to brag about the wonderfullness of C.
.
- Follow-Ups:
- Re: Set a file variable to another
- From: William M. Klein
- Re: Set a file variable to another
- From: Richard
- Re: Set a file variable to another
- References:
- Set a file variable to another
- From: Apokrif
- Re: Set a file variable to another
- From: HeyBub
- Re: Set a file variable to another
- From: Frederico Fonseca
- Set a file variable to another
- Prev by Date: Distributed result set iterator: a design pattern for efficient retrieval of large result sets from remote data sources
- Next by Date: Re: Set a file variable to another
- Previous by thread: Re: Set a file variable to another
- Next by thread: Re: Set a file variable to another
- Index(es):
Relevant Pages
|