HP3000-L Archives

August 2013, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Olav Kappert <[log in to unmask]>
Reply To:
Date:
Sat, 3 Aug 2013 18:26:09 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
First thing to do is to not use cvs.  Use tab delimited.

Then do a unstring of the fields delimited by the tab.

Then strip out the quotes.

Determine the length of each field and right justify each field and zero 
fill the with leading zero.

The move the field to a  numeric field.

You now have your values.

Do this for each field from the unstring.

Long process, but consistent in method.

Olav.

Tony Girgenti wrote:

>Hello,
>
>I'm importing a CSV text file into a HP3000 COBOL II program.
>
>I want to compare a number field from the text file to a number in my COBOL program defined as S9(8)V99.
>
>The CSV text file numeric field looks like this including the quotes: "-312.97".
>
>The text file numeric field can vary in length as "-1,234.99" or "-123,456.99".
>
>If the CSV text file field is always the same length, I know I can move the text field to a COBOL numeric field that is redefined as AlphaNumeric.
>
>The problem is that the input text field can be different for each record.
>
>Does anybody know how to code this in COBOL to accommodate the different number sizes in the text file?
>
>Any help would be gratefully appreciated.
>
>Thanks,
>Tony
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
>  
>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2