Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

fixed and variable length record file under fujitsu
Using fujitsu .net cobol I am trying to create 2 files - a fixed length
data file and a variable length data file. The code sample is below:

000190 DATA DIVISION.
000200
000210 FILE SECTION.
000220
000230 FD  TEST-FILE
000240
000250     LABEL RECORDS STANDARD
000260
000280     RECORD 30
000290     BLOCK CONTAINS 0.
000300
000310 01  TST-REC.
000320
000330     05 TST-KUKU        PIC X(10).
000340
000350     05 TST-DATA        PIC X(20).
000360
000230 FD  TEST-FILEV
000240
000250     LABEL RECORDS STANDARD
000260
000290     BLOCK CONTAINS 0.
000300
000310 01  TST-RECV.
05  VAR-TXT.
10  PIC X OCCURS 0 TO 100 DEPENDING ON VAR-LEN.

Report this thread to moderator Post Follow-up to this message
Old Post
ari
09-05-05 11:55 PM


Re: fixed and variable length record file under fujitsu
On 5 Sep 2005 09:11:39 -0700, "ari" <unikoski@yahoo.com> wrote:

>Using fujitsu .net cobol I am trying to create 2 files - a fixed length
>data file and a variable length data file. The code sample is below:
Please add the SELECT bit as this is of MAJOR importance for your
problem.


>
>000190 DATA DIVISION.
>000200
>000210 FILE SECTION.
>000220
>000230 FD  TEST-FILE
>000240
>000250     LABEL RECORDS STANDARD
>000260
>000280     RECORD 30
>000290     BLOCK CONTAINS 0.
>000300
>000310 01  TST-REC.
>000320
>000330     05 TST-KUKU        PIC X(10).
>000340
>000350     05 TST-DATA        PIC X(20).
>000360
>000230 FD  TEST-FILEV
>000240
>000250     LABEL RECORDS STANDARD
>000260
>000290     BLOCK CONTAINS 0.
>000300
>000310 01  TST-RECV.
>           05  VAR-TXT.
>               10  PIC X OCCURS 0 TO 100 DEPENDING ON VAR-LEN.
>   .
>   .
>   .
>
>
>000610     OPEN OUTPUT TEST-FILEV.
>           MOVE 5 TO VAR-LEN
>           MOVE 'HELLO' TO VAR-TXT.
>           WRITE TST-RECV.
>           SUBTRACT 1 FROM VAR-TXT.
>           WRITE TST-RECV.
>000690     CLOSE TEST-FILEV.
>000590
>000600
>000610     OPEN OUTPUT TEST-FILE.
>000620
>000630     MOVE 'KUKU' TO TST-KUKU.
>000640
>000650     MOVE 'STUM' TO TST-DATA.
>000660
>000670     WRITE TST-REC.
>000630     MOVE 'KUKU' TO TST-DATA.
>000640
>000650     MOVE 'STUM' TO TST-KUKU.
>000660
>000670     WRITE TST-REC.
>000680
>
>
>A number of strange things are happening as a result:
>
>a/ On both output files I receive a very strange extra 3 bytes at the
>beginning of the file. The hexadecimal values of these bytes are: EF BB
>BF.
>
>b/ I am getting an extra 0D 0A at the end of every record.
>
>Any ideas on how to avoid this?


Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com

Report this thread to moderator Post Follow-up to this message
Old Post
Frederico Fonseca
09-06-05 02:56 AM


Re: fixed and variable length record file under fujitsu
Thanks for you reply, and sorry for missing the "SELECT" (silly me!)-
it is:

000110 FILE-CONTROL.
000120
000130     SELECT  TEST-FILE
000140
000150     ORGANIZATION LINE SEQUENTIAL
ASSIGN TO MYFILE.

000130     SELECT  TEST-FILEV
000140
000150     ORGANIZATION LINE SEQUENTIAL
ASSIGN TO MYFILEV.


Report this thread to moderator Post Follow-up to this message
Old Post
ari
09-06-05 02:56 AM


Re: fixed and variable length record file under fujitsu
LINE SEQUENTIAL files are neither "fixed" nor "variable" in the normal (ANSI
/ISO
Standard) files are.

--
Bill Klein
wmklein <at> ix.netcom.com
"ari" <unikoski@yahoo.com> wrote in message
news:1125939868.185272.104620@g14g2000cwa.googlegroups.com...
> Thanks for you reply, and sorry for missing the "SELECT" (silly me!)-
> it is:
>
> 000110 FILE-CONTROL.
> 000120
> 000130     SELECT  TEST-FILE
> 000140
> 000150     ORGANIZATION LINE SEQUENTIAL
>           ASSIGN TO MYFILE.
>
> 000130     SELECT  TEST-FILEV
> 000140
> 000150     ORGANIZATION LINE SEQUENTIAL
>           ASSIGN TO MYFILEV.
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
09-06-05 02:56 AM


Re: fixed and variable length record file under fujitsu
>  000150     ORGANIZATION LINE SEQUENTIAL

Line sequential files are like text editor files.  The Carriage Return
(x0D) and Line Feed (x0A) at the end of each line are the line
terminators.  The trailing spaces should have been stripped from the
record, but this may need an environment variable to tell it to do so.

I have no idea what the EF BB BF are.

You may want these files to be SEQUENTIAL (ie without LINE).  For
variable length sequential files you will get file and record headers
because _something_ has to tell where the records start and end.


Report this thread to moderator Post Follow-up to this message
Old Post
Richard
09-06-05 02:56 AM


Re: fixed and variable length record file under fujitsu
ari wrote:
> Using fujitsu .net cobol I am trying to create 2 files - a fixed
> length data file and a variable length data file. The code sample is
> below:
>
> 000190 DATA DIVISION.
> 000200
> 000210 FILE SECTION.
> 000220
> 000230 FD  TEST-FILE
> 000240
> 000250     LABEL RECORDS STANDARD
> 000260
> 000280     RECORD 30
> 000290     BLOCK CONTAINS 0.
> 000300
> 000310 01  TST-REC.
> 000320
> 000330     05 TST-KUKU        PIC X(10).
> 000340
> 000350     05 TST-DATA        PIC X(20).
> 000360
> 000230 FD  TEST-FILEV
> 000240
> 000250     LABEL RECORDS STANDARD
> 000260
> 000290     BLOCK CONTAINS 0.
> 000300
> 000310 01  TST-RECV.
>           05  VAR-TXT.
>               10  PIC X OCCURS 0 TO 100 DEPENDING ON VAR-LEN.
>   .
>   .
>   .
>
>
> 000610     OPEN OUTPUT TEST-FILEV.
>           MOVE 5 TO VAR-LEN
>           MOVE 'HELLO' TO VAR-TXT.
>           WRITE TST-RECV.
>           SUBTRACT 1 FROM VAR-TXT.
>           WRITE TST-RECV.
> 000690     CLOSE TEST-FILEV.
> 000590
> 000600
> 000610     OPEN OUTPUT TEST-FILE.
> 000620
> 000630     MOVE 'KUKU' TO TST-KUKU.
> 000640
> 000650     MOVE 'STUM' TO TST-DATA.
> 000660
> 000670     WRITE TST-REC.
> 000630     MOVE 'KUKU' TO TST-DATA.
> 000640
> 000650     MOVE 'STUM' TO TST-KUKU.
> 000660
> 000670     WRITE TST-REC.
> 000680
>
>
> A number of strange things are happening as a result:
>
> a/ On both output files I receive a very strange extra 3 bytes at the
> beginning of the file. The hexadecimal values of these bytes are: EF
> BB BF.
>
> b/ I am getting an extra 0D 0A at the end of every record.
>
> Any ideas on how to avoid this?

The '0D0A' is easy. That's Carriage-return/Line-feed which is appended to
the end of every record whose SELECT statement contains "ORGANIZATION IS
LINE SEQUENTIAL"

Take out the following stuff:

LABEL RECORDS STANDARD
BLOCK CONTAINS 0
RECORD nnn



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
09-06-05 02:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:04 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.