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:
"Bahrs, Art" <[log in to unmask]>
Reply To:
Bahrs, Art
Date:
Wed, 7 Aug 2013 20:57:26 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (1 lines)
Hi Tony :)

   Sorry for a short answer... SuprTool is great for this!  And as long as the format stays the same for all records you can do all kinds of things.



Art





Art Bahrs, CISSP

Security Engineer (Oregon Region)

(971) 282-0927



-----Original Message-----

From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf Of Tony Girgenti

Sent: Wednesday, August 07, 2013 1:31 PM

To: [log in to unmask]

Subject: Re: Cobol: Import CSV text file variable length numeric field



Thanks to all for their replies.



I did not explain this in my original post, but I have no control over the format of the input CSV file.  The file is coming from a bank and we have to use what they give us.



I would like to use the UNSTRING command and redefine the two fields that I need which are check number(Reference Number) and check amount(Amount).  Here is a sample of the first two records in the file:



"Date","ABA Number","Currency","Account Number","Account Name","Description","BAI Code","Amount","Serial Number","Reference Number","Detail"

"06/03/2013","999999999","USD","9999999999","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","Check Paid","999","-39,400.65","99999999","999999","CHECK                                                                       <br>"



Of course I replaced all of the numbers with nines and the Account Name with X's.



I realize I need to read past the first record which is a header.



In using the UNSTRING command, I can use ","  OR "<br>" as the DELIMITERS and it should work.



The Amount has a dash in front of it, so I can INSPECT it REPLACING all SPACES and "-" WITH ZERO.



The only problem I have now, is that one of the records looks like this:

"06/03/2013","999999999","USD","9999999999","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX","Check Paid","999","-39,400.65","99999999",,"CHECK                                                                       <br>"



As you can see, the Reference Number is empty with no quotes around it.  I don't know if this is a common occurrence with this file.  I have not contacted the bank yet about that.



I'm not sure of how to handle that field with the UNSTRING command, or if there is some other method I should use.



Thanks,

Tony



* To join/leave the list, search archives, change list settings, *

* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *





________________________________



This message is intended for the sole use of the addressee, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the addressee you are hereby notified that you may not use, copy, disclose, or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete this message.



* To join/leave the list, search archives, change list settings, *

* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


ATOM RSS1 RSS2