MF Cobol (unix) "flat" files 
Author Message
 MF Cobol (unix) "flat" files

While creating a flat sequential file on a Unix version
of MF COBOL I either have a blank line at the top
of the file or the bottom how can I remove both ??

Also this messes up the EOF & EOL delimiters...

any ideas, examples would be appreciated

thanks

George



Thu, 12 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files

Quote:
> While creating a flat sequential file on a Unix version
> of MF COBOL I either have a blank line at the top
> of the file or the bottom how can I remove both ??

Strange.  We use MF Cobol on unix as one of our compilers - I can open output
the file, write a record or two and close the file and there are no extra
blank lines - are you sure you've not forgotten something here ?

Maybe something funny in compile options ? (wild left field guess here)...

Steve.
--

| | | | | |   Analyst Programmer, MIMS/HR | ** Aussie in exile **
| | | | | |   Mincom, Inc.                |
|M|I|N|C|O|M  Denver, Colorado, U.S.A.    | No employer opinion included



Fri, 13 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files

LY>While creating a flat sequential file on a Unix version
  >of MF COBOL I either have a blank line at the top
  >of the file or the bottom how can I remove both ??

There are two kinds of "flat" sequential files that Micro Focus works
with on a UNIX platform. If what you are creating is a "record"
sequential file, then that would explain the "blank" space at the top
of the file. That "blank" space or line is actually a record header
area for the Micro Focus file handlers exclusive use. they are usually
set to a length of 128 bytes and there is an appendix on thier contents
in the system reference manuals.

Unfortunately, when Micro Focuss talks about "line" sequential files
they are refering to text files that can be passed to a printer.
These files should not have any "blank" space at the top of the file
but I remember seeing something mentioned in the system reference
manuals about how thier UNIX version has problems creating the "line"
sequential files. Personally from my experience, I have had no problem
creating "line sequential" report files that are passed to a specific
printer or a terminal. BUT if you are trying to use these files with
another application. that's where the problems begin...

If there is something that the OS/2-Windows version has over the UNIX
version of Micro Focus, it's the lack of a Data File Editor, the lack
of a Hexeditor, and the lack of a work file loader. Three tools that I
for one have been using rather heavily during development phases of my
applications. I know of a LOT of programmers who would greatly benefit
from the use of these tools on a UNIX platform.

But that's enough MF bashing for now.
The RECORD directive of the MF compiler is set to default to thier
"RECORD" sequential files, and you must specify that you want a LINE
sequential file for your output in the SELECT clause statement of your
program. You might have better luck with this type of sequentail file.
GOOD LUCK......


 * 1st 2.00 #6477 * Thesaurus: an ancient reptile with an excellent vocabulary.



Fri, 13 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files
: ... you must specify that you want a LINE sequential file for your
: output in the SELECT clause statement of your program.

I have been using "line sequential" successfully, but trailing spaces
are always stripped off the output lines.  For one application I need to
generate 80-column records containing trailing spaces.  This is just
a regular Unix disk file, a stream of characters.  Is there any way to
get Micro Focus to write such a file?  (Currently I'm post-processing
to pad records with traling spaces, with a shell-script.  Ugly but OK.)

- Victor Odhner,  Phoenix AZ         I'm not at all crazy, but the voices
  http://www.primenet.com/~vodhner   inside my head need some serious help.



Sat, 14 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files
I complained that my line-sequential output (Micro Focus under Unix)
was being written with trailing spaces removed, and I wanted fixed
80-column output.

: Is your FD record length PIC X(80)?  And are you writing your
: file as record sequential?

Thanks for pushing me back to record sequential.

I've been using LINE sequential.  I got into this because record
sequential does not append a newline to each record, and I was
too lazy to learn about hexadecimal constants.  Besides, in
most cases I was happy to have trailing spaces removed.

I just tried record sequential with an 81-column record, with
x"0A" in the 81st position.  That works fine.  For the finished
product I should use this:      78 NEW-LINE value x"0A".

(Is there any way to get COBOL to append the newline when writing
record sequential?)

- Victor Odhner,  Phoenix AZ         I'm not at all crazy, but the voices
  http://www.primenet.com/~vodhner   inside my head need some serious help.



Sun, 15 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files

Quote:

> (Is there any way to get COBOL to append the newline when writing
> record sequential?)

It's a hack, but I'm pretty sure that RELATIVE file organization appends
an X'0A' for active records, and an x'00' for deleted records.  Pretty
ugly, but it ought to work.

---------------------------------------------------------------------------
Eric Raskin                                     Voice:  914-769-7100 x321
The Listworks Corp.                             Fax:    914-769-8070

Pleasantville, NY 10570



Sun, 15 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files


Quote:

> I just tried record sequential with an 81-column record, with
> x"0A" in the 81st position.  That works fine.  For the finished
> product I should use this:      78 NEW-LINE value x"0A".

> (Is there any way to get COBOL to append the newline when writing
> record sequential?)

> - Victor Odhner,  Phoenix AZ         I'm not at all crazy, but the voices
>   http://www.primenet.com/~vodhner   inside my head need some serious help.

Hi,

I am glad that you have resolved your initial problem, to get
a record per line, I think (but don't quote me on it), but in
Micro Focus Cobol, you can specify a clause such as:-

        Write Output-Record Before Advancing 1 Line.

I don't have a manual to hand, but I think this is the syntax,
but I'm not sure if a standard CRLF is added or not (my guess
is it's not).

Anyway, give it a try, it's either work or not!

Rgds,

Mark W.
--
------------------------------------------------------------

    In The Quiet Of The Night, Let Our Candle Always Burn
    Let Us Never Lose The Lessons We Have Learned.
------------------------------------------------------------



Sun, 15 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files
: In 0Micro Focus Cobol, you can specify a clause such as:-
:       Write Output-Record Before Advancing 1 Line.

 I tried it just now.  It appends LF + CR.  The CR character makes the
 file ugly to look at in the Unix world, but for most applications like
 this it should be just fine from a functional point of view.

 Dude!  Thanks again.   - Vic Odhner   Phoenix AZ USA



Sun, 15 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files

Quote:

> I just tried record sequential with an 81-column record, with
> x"0A" in the 81st position.  That works fine.  For the finished
> product I should use this:      78 NEW-LINE value x"0A".

> (Is there any way to get COBOL to append the newline when writing
> record sequential?)

If you write the file as RELATIVE you would need to maintain the
relative key but this would write records with a terminator,
on my uses it put x"0d0a" on valid records and x"0d00" on
deleted or unwritten records.  This was DOS and older MF
compilers.

On Unix it should use x"0a" or x"00" unles you put the two byte
terminator switch on.



Tue, 17 Mar 1998 03:00:00 GMT  
 MF Cobol (unix) "flat" files
Richard

thanks alot for your response..hopefully I'll be able
to try it by friday...

=============================================================
George R Lewycky       "I'd rather be on Titan !!"

try me:        http://soho.ios.com/~lewycky/




=============================================================



Mon, 30 Mar 1998 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. MF Cobol ".FDD" Files

2. MF COBOL 3.2 using "CHAIN" command

3. MF COBOL "windowing" preprocessor

4. MF Cobol CALL X"F5"

5. US - FL -****UNIX/UNIXFOCUS PROGRAMMER ("C", INGRESS,UNIX OS)****CONTRACT

6. Flat Buttons and "MSG"

7. "Rewinding" files in COBOL

8. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

9. MF COBOL (unix) problem ( reading in file )

10. Unix->MVS file transfer; MF COBOL

11. COBOL FAQ - and the topic of "off-toic"posts in the COBOL Newsgroups

12. MF COBOL Server Express and Large Files in Unix

 

 
Powered by phpBB® Forum Software