[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | VAX/DEC COBOL |
Notice: | Kit,doc,performance talk info-->DIR/KEY=KIT or DOC or PERF_TALK |
Moderator: | PACKED::BRAFFITT |
|
Created: | Mon Feb 03 1986 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3250 |
Total number of notes: | 13077 |
3208.0. "sequential file record length on UNIX" by EVTAI1::ROCHE () Thu Feb 27 1997 11:17
I would like to get a unix sequential file containing no delimiter
the file has a fixed record length.
If the length is even, I got no padding character, but of course, I am
interested with an odd length and I got a null chracater at the end of
each record. I tried to add a RECORD CONTAINS without success.
.LINE SEQUENTIAL adds 0A. *DC SET NOALIGNMENT does'nt change anything
could someone help me please.
thanks
Flavie
UNIX 3.2 COBOL 2.3
identification division.
PROGRAM-ID. TESTLGREC.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FO
ASSIGN TO "SORTIE".
DATA DIVISION.
FILE SECTION.
FD FO.
*DC SET NOALIGNMENT
01 R.
02 K1 PIC X(4).
02 K2 PIC 9(7).
*DC SET ALIGNMENT
WORKING-STORAGE SECTION.
01 S PIC XX.
PROCEDURE DIVISION.
P0.
OPEN output FO.
MOVE SPACES TO k1.
MOVE 1234567 TO K2.
bcl.
WRITE R.
add 1 to k2.
if k2 < 1234600 then go to bcl.
CLOSE FO.
STOP RUN.
T.R | Title | User | Personal Name | Date | Lines |
---|
3208.1 | | WENDYL::BLATT | | Thu Feb 27 1997 13:20 | 7 |
| Odd-length fixed records are padded out to be even-length intentionally.
This is for compatibility with VMS created files which also
pad odd-length files.
This pad byte should be invisible to your cobol application however.
|