For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2004 > Re: UNSTRINGing a CSV line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: UNSTRINGing a CSV line
Lueko Willms

2004-09-28, 3:55 am

.. Am 23.09.04
schrieb robert@wagner.net.yourmammaharvests (Robert Wagner)
bei /COMP/LANG/COBOL
in j4e6l01ait5eplet99sk7jar962lglatrv@4ax.com
ueber Re: UNSTRINGing a CSV line
[color=darkred]

RW> Should be: TALLYING IN item-length

No, you are confusing TALLYING IN and COUNT IN

TALLYING counts the number of items moved to CSV-item(item-number)
(in this example), while COUNT IN counts the number of characters
examined for the single move, i.e. the length of Next-Token.

like this:

UNSTRING CSV-Line
DELIMITED BY CSV-Line[CSV-Pointer - 1:1]
INTO CSV-item-text(item-number)
COUNT IN CSV-item-length(item-number)
TALLYING IN item-number


where CSV-item-text and CSV-item-length would be two items
subordinate to a group item with an OCCURS clause long enough for a
large number of items, e.g. like this:

01 CSV-item-table.
02 CSV-item OCCURS 200 TIMES.
03 CSV-item-length PIC 9(04) COMP.
03 CSV-item-text PIC X(256).




Yours,
Lüko Willms http://www.mlwerke.de
/--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --

"Die Interessen der Nation lassen sich nicht anders formulieren als unter
dem Gesichtspunkt der herrschenden Klasse oder der Klasse, die die
Herrschaft anstrebt." - Leo Trotzki (27. Januar 1932)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com