Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6222313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:17:35+00:00 2026-05-24T08:17:35+00:00

I have the following COBOL files: .DAT, .IDX and fd (file definition) file. We

  • 0

I have the following COBOL files: .DAT, .IDX and fd (file definition) file. We are using COBOL Net Express from MicroFocus.

  1. Now at first I would like to create MsSql table from this Cobol file definiton. The file defintion has this inside:

    FD PREGLA DATA RECORD IS FPG-REC.
    01 FPG-REC.
    02 FPG-STA PIC X(01).
    02 FPG-KEY.
    03 FPG-FRM PIC X(02).
    03 FPG-ODD PIC X(02).
    03 FPG-DOK PIC 9(08) BINARY.
    02 FPG-POZ PIC 9(06) BINARY.
    02 FPG-PRM.
    03 FPG-IND PIC 9(01) OCCURS 10 TIMES.
    ………and so on

Is it possible to import this file into Microsoft SQL server 2008? We are also using Sql server Managment studio. Now I tried SQL server import and export wizard, but it does not have import for this kind of file.

I have also looked in NET Express, but without any luck. Is it even possible to get SQL table definiton from COBOL fd?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:17:36+00:00Added an answer on May 24, 2026 at 8:17 am

    Creating SQL table definitions from COBOL record layouts is not always
    a straight forward process (going the other way is pretty simple though).

    The problem is that COBOL record layouts can be quite complex with various
    overlays (COBOL REDEFINES) and denormalizations (COBOL OCCURS). These pretty much
    defeat most attempts to automate the process of mapping a complex COBOL Record to
    an SQL table layout.

    Data type mapping can also be a bit of a challenge. Net Express files may
    be created to target either ASCII or EBCDIC (IBM Mainframe) based environments. If your files
    are encoded in EBCDIC you will most likely have to write custom conversion software
    because
    your file contains mixed character/numeric data (there may be third party products that can automate, or partly automate, this type of conversion but I am not familar with them).

    Try looking at one of the .DAT files with a simple text editor (e.g. notepad). If
    you can read the character data then it is ASCII based – and you have a fighting chance
    of loading the data without much additional conversion effort.

    COBOL field definitions that are PIC X something contain character data and
    translate directly into SQL CHAR data of a similar length (i.e. PIC X(4) becomes CHAR(4)).

    COBOL fields definitions defined as BINARY translate into SQL INTEGER. Whether the integer
    is long or short depends on the number of digits. For example PIC S9(8) BINARY specifies
    a signed binary integer of 8 digits – that would occupy 4 bytes. On the other hand,
    PIC S9(4) BINARY is only 4 digits so would occupy 2 bytes (short integer).

    Another common COBOL field definition is PACKED-DECIMAL or COMP-3. These fields
    may translate into SQL DECIMAL data types.

    SimoTime provides a very good overview for several
    COBOL field definitions. Working out the translation into the appropriate SQL data type
    should not be difficult.

    Note 1: From the COBOL record layout fragment provided in your question I can see an OCCURS clause.
    Because of this, the resulting table will not
    even be in First Normal Form.
    These tables can be a real pain to manage in a database environment.

    Note 2: The useable data will be found in the .DAT files. The record layout will correspond to the COBOL record definition. The .IDX files contain indexing data used by MicroFocus when reading/writing. You can ignore these.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code snippet in one of my COBOL program. IF FIRST
I have the following code snippet, which loads data from a CSV file into
I have following fiddle: http://jsfiddle.net/BFSH4/ As you see there are two issues: The h1
I have following script that executes all the .reg files in the current directory.
I have following nested objects. I am using @Valid for validation in my controller.
I have to read a binary file in python. This is first written by
im trying to tokenize text files using the following code: String fileContent = ;
I have many Java files from a project which have not been formatted properly.
I have the equivalent of the following in a batch script: net localgroup Cool
Let's say I have the following table first last value tony jones 1 james

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.