Re: AIX Cobol II and Packed Decimal fields
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 03:56:53 GMT
Rather than using the RECORDING MODE V (IBM extension),
I would recommend using the ('85 Standard - supported on all IBM platforms)
Record Varying in Size from n to n Depending on WS-Item.
If you do that and define the file as (record) Sequential, I believe the AIX
COBOL should work "fine".
--
Bill Klein
wmklein <at> ix.netcom.com
"Richard" <riplin@xxxxxxxxxxxx> wrote in message
news:1130468188.817154.177380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> the 0d a carriage return... which means you cant have SIGNED
>> PACKED DECIMAL in a variable length
>> file in a UNIX type file format on AIX....
>
> You cannot have any packed or comp in a _LINE_ sequential file, but
> that isn't the only way to have a variable length file in Cobol.
>
> IDENTIFICATION DIVISION.
> PROGRAM-ID. alf.
> ENVIRONMENT DIVISION.
> CONFIGURATION SECTION.
> INPUT-OUTPUT SECTION.
> FILE-CONTROL.
> SELECT ALF-FILE ASSIGN TO NAT-VAR
> organization is sequential.
> DATA DIVISION.
> FILE SECTION.
> FD ALF-FILE
> recording mode is V.
> 01 ALF-REC.
> 03 Alf-Count PIC S9(4).
> 03 Alf-Parts OCCURS 1 TO 25 DEPENDING ON Alf-Count.
> 05 Alf-Packed PIC S9(7).
> WORKING-STORAGE SECTION.
> 01 WS-REC.
> 03 WS-NUM PIC S9(3) sign leading separate.
> 03 WS-NUM-CM PIC S9(3) COMP-3.
> 01 Nat-Var PIC X(20) VALUE "TESTVLEN.DAT".
> PROCEDURE DIVISION.
> 000-START SECTION.
> open output ALF-FILE.
> MOVE 1 TO Alf-Count
> move -10 to WS-Num
> MOVE WS-Num TO Alf-Packed(Alf-Count)
>
> DISPLAY ALF-REC.
> write ALF-REC.
> 010-add.
> add 1 to WS-NUM.
> * move WS-NUM to WS-NUM-CM.
> * move WS-REC to ALF-REC.
> ADD 1 TO Alf-Count
> MOVE WS-Num TO Alf-Packed(Alf-Count)
> DISPLAY ALF-REC.
> write ALF-REC.
> if WS-NUM not = 10
> go to 010-add.
> 020-end.
> CLOSE ALF-FILE.
> stop run.
> * EXIT.
>
.
- Follow-Ups:
- Re: AIX Cobol II and Packed Decimal fields
- From: Richard
- Re: AIX Cobol II and Packed Decimal fields
- References:
- AIX Cobol II and Packed Decimal fields
- From: alf
- Re: AIX Cobol II and Packed Decimal fields
- From: William M. Klein
- Re: AIX Cobol II and Packed Decimal fields
- From: alf
- Re: AIX Cobol II and Packed Decimal fields
- From: alf
- Re: AIX Cobol II and Packed Decimal fields
- From: Richard
- Re: AIX Cobol II and Packed Decimal fields
- From: alf
- Re: AIX Cobol II and Packed Decimal fields
- From: Richard
- AIX Cobol II and Packed Decimal fields
- Prev by Date: Re: AIX Cobol II and Packed Decimal fields
- Next by Date: Re: AIX Cobol II and Packed Decimal fields
- Previous by thread: Re: AIX Cobol II and Packed Decimal fields
- Next by thread: Re: AIX Cobol II and Packed Decimal fields
- Index(es):
Relevant Pages
|
|