Page 1 of 1

How to Export data from MainFrame to CSV

PostPosted: Wed Aug 16, 2017 1:32 am
by Nammer
Hello, Have a similar problem and suggested to mainframe developer to try your way, but he insists that it would take thousands of lines of code to set because he would have to set the byte start and end of the columns. Insists it would take too long and gives me a row fixed width text file I can't even import into Sql server or excel to save as cab for Sal server import. Can u help?

Re: How to Export data from MainFrame to CSV

PostPosted: Wed Aug 16, 2017 1:39 am
by Robert Sample
First, when you have a question -- start a new topic. Do NOT tag on the end of a nine-year-old topic! I split your question from the original topic.

Second, your question makes no sense. Excel imports fixed-width data just fine, so why are you having problems?

Re: How to Export data from MainFrame to CSV

PostPosted: Wed Aug 16, 2017 8:13 am
by steve-myers
It seems to me this mainframe developer is full of waste products in cow pastures. When I did this task using data extracted from SMF- in Assembler, no less - I spent more time reordering the data so it made sense for Excel rather than for a printed report. The actual code to generate the CSV data took less than a day. For what it's worth the CSV data went to a separate data set. It was variable length records, but with a little extra effort on my part it could have been fixed length records.

Re: How to Export data from MainFrame to CSV

PostPosted: Fri Sep 08, 2017 2:40 am
by Nammer
The fixed width file he sends me is the fixed width of the whole row. Which to me is a very lazy way to output the file.
Ex: length of the rows in file 38
File rows:
FirstNameLastNameAddresszipcodephone

Not fixed width by column.

Re: How to Export data from MainFrame to CSV

PostPosted: Fri Sep 08, 2017 7:12 am
by Robert Sample
If the columns are not fixed width, how do you know when one field ends and another field begins? There HAS to be some kind of delimiter to separate the fields -- otherwise, how do you know if SUSIEONEAL is SUSIE (first name) ONEAL (last name) or SUSIEO (first name) NEAL (last name)? If you say there is no delimiter between the fields, then what you want to do is IMPOSSIBLE. You MUST have some way to split the fields or you cannot generate CSV (comma-delimited) data from the data set.

And your developer is completely full of BS. I have added comma delimiters, using SAS in some cases and using DFSORT in other cases, to data sets with dozens to hundreds of fields and it has never taken more than a week to complete the task (often just half a day). Using COBOL took the longest, IIRC.