Alain Reymond wrote:
> jeff a écrit :
>> On May 13, 10:27 am, Howard Brazee <how...@[EMAIL PROTECTED]
> wrote:
>>
>>> On Tue, 13 May 2008 06:37:11 -0700 (PDT), jeff <jmoore...@[EMAIL PROTECTED]
>
>>> wrote:
>>>
>>>
>>>> I have a input rec coming from a customer that is defined as
>>>>
>>>> FD DISCFILE.
>>>> 01 DISC-REC PIC X(129).
>>>> 01 DISC-REC2 REDEFINES DISC-REC.
>>>> 03 DISC-RECR OCCURS 129 PIC X.
>>>>
>>>> It is a comma-delimited file with 16 fields (15 commas). I need to
>>>> check and make sure that each line is only 129 characters and I
>>>> assume 1 LF. What would be the best way to accomplish this?
>>>>
>>> Are you reading an ASCII file from one Windows machine to another
>>> Windows machine?
>>>
>>
>> Unix ascii file
>>
> Jeff, if you use line sequential files, you should not have to care
> about the LF. The records will be 129 chars long.
> Then, use unstring :
> 1 my-record.
> 2 my-field pic(129) occurs 16.
> ....
>
> unstring DISC-REC
> delimited by ";" or "," or x'09'
> into
> my-field(01),
> my-field(02),
> my-field(03),
> my-field(04),
> my-field(05),
> my-field(06),
> my-field(07),
> my-field(08),
> my-field(09),
> my-field(10),
> my-field(11),
> my-field(12),
> my-field(13),
> my-field(14),
> my-field(15),
> my-field(16)
> end-unstring
>
>
Or, my favored technique:
MOVE 1 TO DISC-POINTER.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 16
UNSTRING DISC-REC DELIMITED BY ',' INTO MY-FIELD(I)
WITH POINTER DISC-POINTER
END-PERFORM


|