Re: sequential file formats
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 01:13:00 GMT
The following is s SLIGHT modification of your program that should work in any
(?) '85 Standard (high) COBOL compiler and I think will work with Open-Cobol
(but I haven't tried it).
I have two commented lines in the Select statement
- change to the 2nd variation if your compiler doesn't support "literals" in
ASSIGN TO
- uncomment "RECORD" if your compiler supports both RECORD SEQUENTIAL and LINE
SEQUENTIAL (which I think O-C does).
- in "My" compiler the "I" of Identification Division is in column 8 - but isn't
in this text. That will need to be changed for compilers with A-/B-margin
restrictions. Similarly, the B-margin items seem to have been "shifted over" in
this text (and need to start in column 12 - or later).
I ran this with Fujitsu "flagging" turned on - so if I missed any extensions
(because their flagging is weak), let me know:
IDENTIFICATION DIVISION.
PROGRAM-ID. test1.
environment division.
input-output section.
file-control.
Select AFILE assign to "output.dat"
* Select AFILE assign to OUTPFILE
organization is
* RECORD
sequential
access is sequential
.
DATA DIVISION.
FILE SECTION.
FD AFILE
record varying in size from 1 to 50
depending on a-length
. .
01 a-file.
05 big-record pic x(50).
WORKING-STORAGE SECTION.
01 A-GRP.
05 A-ELE PIC X(50).
01 A-LENGTH Binary PIC 9(4).
PROCEDURE DIVISION.
Mainline.
OPEN OUTPUT AFILE
MOVE ALL HIGH-VALUES to a-grp
MOVE 20 TO A-LENGTH
WRITE A-FILE FROM A-GRP
MOVE ALL LOW-VALUES to a-grp
MOVE 30 TO A-LENGTH
WRITE A-FILE FROM A-GRP
CLOSE AFILE
.
STOP RUN
.
--
Bill Klein
wmklein <at> ix.netcom.com
"theador" <Theador@xxxxxxxxx> wrote in message
news:1122413922.494578.13640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Thank you all for the feed back. Yes, my program has problems as I am
> not a COBOL expert and I was compiling on a substandard compiler
> (open-cobol). I am financially constrained, so I can not afford to buy
> a commercial COBOL compiler. My goal in this exercise is to get sample
> data to test routines that convert sequential files between the various
> formats. I am writing the conversion routines in C (a language in
> which I am proficient).
>
> At this time I am not concerned about C-ISAM, VSAM, or LINE SEQUENTIAL
> FILES.
>
> Theador.
>
.
- Follow-Ups:
- Re: sequential file formats
- From: theador
- Re: sequential file formats
- References:
- sequential file formats
- From: theador
- Re: sequential file formats
- From: William M. Klein
- Re: sequential file formats
- From: theador
- sequential file formats
- Prev by Date: Re: Oracle CASE statement precompile error in Micro Focus
- Next by Date: about 16bit cobol migration to .net
- Previous by thread: Re: sequential file formats
- Next by thread: Re: sequential file formats
- Index(es):
Relevant Pages
|