input file help please!!!! 
Author Message
 input file help please!!!!

 I'm trying to write a simple program that will read an input file in
 ASCII text format. Could someone fill out the below blank lines:

        FILE-CONTROL.
                SELECT INV-M-FILE ASSIGN TO "A:INV60"
                        ORGANIZATION IS _______________
                        ACCESS MODE________________
                        RECORD KEY IS WBS-ID.

 or I may not need those lines. I'm writing this program in MF Cobol on my PC.
 Any hints or answers will be appreciated. Thanks.



Sat, 21 Feb 1998 03:00:00 GMT  
 input file help please!!!!

Quote:

> I'm trying to write a simple program that will read an input file in
> ASCII text format. Could someone fill out the below blank lines:
>    FILE-CONTROL.
>            SELECT INV-M-FILE ASSIGN TO "A:INV60"
>                    ORGANIZATION IS _______________
>                    ACCESS MODE________________
>                    RECORD KEY IS WBS-ID.
> or I may not need those lines. I'm writing this program in MF Cobol on my PC.
> Any hints or answers will be appreciated. Thanks.

Tin,

Well, talk about the blind leading the blind!! I am trying to learn
this MF Cobol also. I am on day 12 of the "Teach Yourself MF Cobol in
21 days" so I guess I am more than half way to being totally
incompetent!! Seriously though, here is an example of what I think you
need:

        SELECT VENDOR-FILE
                ASSIGN TO "VENDOR.DAT"
                ORGANIZATION IS INDEXED
                RECORD KEY IS VENDOR-NUMBER
                ACCESS MODE IS DYNAMIC.

There are two other access modes, I think, but DYNAMIC seems to be the
preferred method on INDEXED files. If the file you are reading is not
indexed, then I think the organization is SEQUENTIAL and you don't
need the ACCESS MODE and RECORD KEY lines. In this scenario, the way
you open the file determines what you can do with it (read, write,
create, etc.). Hey, this could be totally wrong but if it is, maybe
someone will enlighten both of us. In the interim, at least this gives
you something to try!

Good luck,
Chuck



Sun, 22 Feb 1998 03:00:00 GMT  
 input file help please!!!!

Quote:


> > I'm trying to write a simple program that will read an input file in
> > ASCII text format. Could someone fill out the below blank lines:

> >       FILE-CONTROL.
> >               SELECT INV-M-FILE ASSIGN TO "A:INV60"
> >                       ORGANIZATION IS _______________
> >                       ACCESS MODE________________
> >                       RECORD KEY IS WBS-ID.

> > or I may not need those lines. I'm writing this program in MF Cobol on my PC.
> > Any hints or answers will be appreciated. Thanks.

> Tin,

> Well, talk about the blind leading the blind!! I am trying to learn
> this MF Cobol also. I am on day 12 of the "Teach Yourself MF Cobol in
> 21 days" so I guess I am more than half way to being totally
> incompetent!! Seriously though, here is an example of what I think you
> need:

>    SELECT VENDOR-FILE
>            ASSIGN TO "VENDOR.DAT"
>            ORGANIZATION IS INDEXED
>            RECORD KEY IS VENDOR-NUMBER
>            ACCESS MODE IS DYNAMIC.

> There are two other access modes, I think, but DYNAMIC seems to be the
> preferred method on INDEXED files. If the file you are reading is not
> indexed, then I think the organization is SEQUENTIAL and you don't
> need the ACCESS MODE and RECORD KEY lines. In this scenario, the way
> you open the file determines what you can do with it (read, write,
> create, etc.). Hey, this could be totally wrong but if it is, maybe
> someone will enlighten both of us. In the interim, at least this gives
> you something to try!

From what I gather from the original poster, the input file is in "text" format
(ie, CRLF terminated lines of varying lengths, as output by your favourite
text editor). For this type of file, the organisation you require is
LINE-SEQUENTIAL (an MF extension). You don't need the ACCESS MODE (if you do
want to specify it, it can only be SEQUENTIAL) and KEY (there is no
concept of keys for record sequential files, of which this is a variant)
clauses.

Cheers,
Kev.
--


These views are strictly my own.
I doubt very much that anyone else would want them.



Sun, 22 Feb 1998 03:00:00 GMT  
 input file help please!!!!
Suggest looking at
     ORGANIZATION IS LINE SEQUENTIAL
clause if the text file is CR/LF delimited.

Also one would be very wise to include FILE STATUS IS file-status-var-name

along with     01 file-status-var-name.
                    02 high-digit-f-s pic 9 value 0.
                    02 low-digit-f-s pic x.

and then checking the values of high-digit-f-s / low-digit-f-s after each
I/O verb (i.e. OPEN, READ, WRITE, CLOSE).

Non-zero values should (usually) cause immediate cessation of execution
(with the exception of value 1 (high) and 0 (low) which indicates EOF).



Sun, 22 Feb 1998 03:00:00 GMT  
 input file help please!!!!

Quote:

> Path:

news.pi.net!news.sara.nl!news.nic.surfnet.nl!howland.reston.ans.net!usc!nic-nac
CSU.net!newshub.sdsu.edu!ucsnews!rohan.sdsu.edu.sdsu.edu!tran2
Quote:

> Newsgroups: comp.lang.cobol
> Subject: input file help please!!!!
> Date: 5 Sep 1995 21:36:52 GMT
> Organization: San Diego State University
> Lines: 12

> NNTP-Posting-Host: 130.191.1.100

>  I'm trying to write a simple program that will read an input file in
>  ASCII text format. Could someone fill out the below blank lines:

>    FILE-CONTROL.
>            SELECT INV-M-FILE ASSIGN TO "A:INV60"
>                    ORGANIZATION IS line sequential_______________
>                    ACCESS MODE_sequential_______________
>                    RECORD KEY IS WBS-ID.

>  or I may not need those lines. I'm writing this program in MF Cobol on my
PC.
>  Any hints or answers will be appreciated. Thanks.

No sweat.
Peter Snijders
Holland


Sun, 22 Feb 1998 03:00:00 GMT  
 input file help please!!!!

Quote:
> I'm trying to write a simple program that will read an input file in
> ASCII text format. Could someone fill out the below blank lines:

>    FILE-CONTROL.
>            SELECT INV-M-FILE ASSIGN TO "A:INV60"
>                    ORGANIZATION IS _______________
>                    ACCESS MODE________________
>                    RECORD KEY IS WBS-ID.

> or I may not need those lines. I'm writing this program in MF Cobol on my PC.
> Any hints or answers will be appreciated. Thanks.

MF COBOL supports the KEYBOARD assignment option, so all you need is

SELECT INV-M-FILE ASSIGN TO KEYBOARD "A:INV60"
                  ORGANIZATION IS LINE SEQUENTIAL
                  FILE STATUS IS FS.

Actually you might not need the FILE STATUS clause.  One thing you may need to
do is to MOVE LOW-VALUES TO INV-M-RECORD before reading as a read of a short
record following a read of a longer record may only partially replace the previous
value in INV-M-RECORD.

Sal Cambareri  --  SSC Consulting, Inc.

e puro si movi



Sun, 22 Feb 1998 03:00:00 GMT  
 input file help please!!!!
:  I'm trying to write a simple program that will read an input file in
:  ASCII text format. Could someone fill out the below blank lines:

:       FILE-CONTROL.
:               SELECT INV-M-FILE ASSIGN TO "A:INV60"
:                       ORGANIZATION IS _______________
:                       ACCESS MODE________________
:                       RECORD KEY IS WBS-ID.

:  or I may not need those lines. I'm writing this program in MF Cobol on my PC.
:  Any hints or answers will be appreciated. Thanks.
:      

It depends on what nature the ASCII text file is.

If it is text with Carraige Returns and Line Feeds, the orgranization
is LINE SEQUENTIAL, otherwise it is BINARY SEQUENTIAL.

The ACCESS line is not needed since the only form of access is sequential.

The record key line should not exist since it is not Indexed.
If you use declaratives, a STATUS line is in order.

Your FD statement will vary by file layout.
If it is a CR/LF delimited file, you may want two records, one a single byte,
the other as long as the longest line.  Remember to move LOW-VALUES into the
longer before each READ.

If it is fixed record ASCII, set the record length accordingly.

Your other option is to read it in a byte at a time and assemble a record
in working storage.


A.F.Software Services, Inc. | Your MS/DOS, UNIX
(708) 232-0790              | business software developer



Tue, 24 Feb 1998 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Help on opening multiple input files(test vector files)

2. missing input/output problem, please help

3. Input/Output-Interface for Fortran program - please help :-)

4. Please help with feeding a popen2 pipe with a large input

5. Still cannot input chinese...Please help

6. please, please, please, please, help

7. will someone please, please, please, please HELP me?!!

8. Please Help - NetTools Help File needed

9. VSE 3.1 Repository Problem: Please help (please please?)

10. help on awk and ASCII file input

11. Help needed for working with two input files

12. PLEASE PLEASE PLEASE HELP !!!!!!!!!!!!

 

 
Powered by phpBB® Forum Software