x
login about faq Site discussion (meta-askssc)

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 '10 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 '10 at 12:56 AM

Matt Whitfield gravatar image

Matt Whitfield ♦♦
29.2k 56 63 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 '10 at 06:01 PM

Squirrel gravatar image

Squirrel
440 1 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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x224
x14

asked: Oct 01 '10 at 07:51 PM

Seen: 1483 times

Last Updated: Oct 01 '10 at 07:51 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.