Re: sequential file formats



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.
>


.



Relevant Pages

  • Re: HP3000 COBOL copy libraries
    ... The Cobol compiler won't be able to do it so your only solution is to ... search a series of MPE groups in order to find a copylib module. ... To join/leave the list, search archives, change list settings, * ...
    (comp.sys.hp.mpe)
  • Support Open & GCC-COBOL (was: New Cobol compiler written in Cobol)
    ... wrote paul@NOSPAMcode-compiler.com (Paul Robinson) ... PR> I am considering the development of a Cobol compiler itself written ... Since the efforts for a free COBOL compiler mentioned above are ...
    (comp.lang.cobol)
  • Re: R: GOBACK (was: Perform Thru/Go to vs. Perform - Compile Speed
    ... between a C compiler and a COBOL compiler, ... Same as writing a Pascal compiler... ... If you seek someone to blame for the high cost of Cobol compilers, ...
    (comp.lang.cobol)
  • Re: Actual COBOL in Commodore 64
    ... There was even a COBOL compiler, in fact I actually have a copy of ... They did a number of compilers for VIC, C64 & C128 ... Had Commodore had decent management ...
    (comp.lang.cobol)
  • Re: Layout Hell.
    ... She cannot write 20 conversion programs because she doesn't ... Whether she has access to a Cobol compiler isn't clear. ... > I 'wrote the script' internally, then used it to convert the file. ...
    (comp.lang.cobol)