John, I am sure you already know this, and given what you have already related to us of your management's general bad attitude to z/OS Unix it is probably a long shot, but z/OS Unix "awk" can probably process those CSV files quicker than COBOL UNSTRING. I have a robust CSV splitter function in awk if you are interested. It could easily be architected into an awk main program that takes in a CSV file and a file of "field lengths and types" as input associated with each input CSV to automatically format the output record, including left justification with trailing blanks for non-numeric fields and right justification with leading zeros for numeric fields.
Then all your programmers would have to do is "code" input field-length-and-type files unique to each CSV. And z/OS Unix awk has the great advantage of being able to both input and output normal sequential files, not just Unix file system files (it uses fopen not open). So you could conceivably "package" the whole thing into a nice little "black box" solution. Let me know if you are interested in the CSV splitter function. Another alternative might be if the vendor can send XML files instead of CSV. COBOL V3.4 can process XML files (XML PARSE statement), and that might or might not be more efficient than UNSTRING. HTH Peter -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of John McKown Sent: Monday, September 12, 2016 10:05 AM To: [email protected] Subject: CSV delimited file to "normal" fixed length char fields, in COBOL. We are running z/OS 1.12 on a z9BC. We have COBOL 3.4. Neither will ever be upgraded. We will not obtain new hardware or software. Given the absolute truth of the preceding :-( does anybody know a better way to convert a CSV file, coming in from a UNIX box, to a "normal" sequential file with fixed length character fields. At present we use the UNSTRING verb to do this. We get these files daily and they are 100s of thousands to a bit over a million records. This takes a while, both wall clock and CPU wise. Oh, these actually use the pipe symbol, | (0x4F) and not a comma, if that is of any relevance. Please don't suggest HLASM because our programming staff (two people) basically knows only two languages: COBOL and CA-EasyTrieve. Yes, we are leaving the z/OS arena. We should have been off of it at the end of last month, but the off-site vendor (CSC) basically said that they couldn't do what our actuarial people need done, so CSC sends us file with we use to load VSAM data sets which the actuarial people then use in their processes. Supposedly, this will only stay around until the actuaries find a different way to do their jobs on Windows effectively. But I'm not in that loop (Personally, I'd look at the R language - free & almost as good as SAS). -- Unix: Some say the learning curve is steep, but you only have to climb it once. -- Karl Lehenbauer Unicode: http://xkcd.com/1726/ Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
