x

Need to output a flat fixed-length file (some fields are COMP and COMP-3 format) with MS SQL 2008 TSQL for loading into mainframe

Need to output a flat fixed-length file (some fields are COMP and COMP-3 format) with MS SQL 2008 TSQL for loading into mainframe. How do convert the data from ASCII to COMP, COMP-3, EBCDIC format.

The mainframe utilizes COBOL programs and the vendor cannot modify; so I need to meet their file format requirements.
more ▼

asked Oct 01, 2010 at 07:51 PM in Default

cpacosta gravatar image

cpacosta
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

The best way to achieve this is probably going to be by knocking up a C# app to query the database and write the data to the file as you want.

However, existing code wise, it seems most people go the other way - i.e. from legacy formats to new - so you might have to write some encoder code yourself...
more ▼

answered Oct 02, 2010 at 12:56 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.5k 61 65 87

(comments are locked)
10|1200 characters needed characters left
output it to a text file and ask vendor to write a separate cobol proggram to convert it to the required format on the mainframe
more ▼

answered Oct 03, 2010 at 06:01 PM

Squirrel gravatar image

Squirrel
2.5k 1 2 4

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x292
x18

asked: Oct 01, 2010 at 07:51 PM

Seen: 2174 times

Last Updated: Oct 01, 2010 at 07:51 PM