question

cpacosta avatar image
cpacosta asked

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.
tsqloutput
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Whitfield avatar image
Matt Whitfield answered
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...
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Squirrel avatar image
Squirrel answered
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
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.