David J Murray Dev
~ Learn and Do - Excel and Share ~

SB+ and CSV Export

Jul 10, 2007
You're Reading: SB+ and CSV Export

A situation has come up where a client wishes to extract out on a regular basis a series of CSV flat files of UniVerse data.

Using the SB+ Report Writer I can use the Output Device of ‘D’ (DIFF). This will write out the data in a comma delimited format.

I added the fields along one line, the first line a ‘C’ for columns and the second line a ‘D’ for data. I also overrode the length of each field to 10, as the length is ignored when the extraction occurs.

It is also possible to use additional conversion codes e.g. MCL.

The only issues is how to handle multivalue fields. For text where formatting is not that important, I do a TRANS on the field so the multivalues are combined together. More important multivalves, like transactions in an association, I create a new report and export then out as a separate file.

To make is easy to access the resultant CSV files, I created a new file of type 19 (dictionary) and updated the report details on the Additional Report Parameters screen.

Using this method, it is easy to maintain, even using the user prompting ‘?’ in the selection criteria.

Things to watch for are spaces between the headings in the column line else they will merge into one field. Also, as SB+ just concatenates each field onto the previous, separating them by a comma, the last field will have a trailing comma; hence the whole line/record will end with a comma. It is not really standard, but MS-EXCEL will load the resultant file OK.

Otherwise, it is fast and tidy. It will even compile if needed.

About the Author

<a href="https://davidjmurray.dev/losucag/davidjmurray/" target="_self">djm</a>


I have been in the computer/IT industry for over 35 years. After spending half a life-time in highly proprietary database environments, I have succumbed to the WordPress Eco-system and I'm well down the chasm. I am specializing in AWS hosting, Wordpress CMS, Elegant Themes, in particular Divi and Extra themes.


Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This