Search code examples
excelcobolmainframejclvba

Excel spreadsheet to COBOL program


I have a task to migrate an Excel Macro(Which basically does screen scraping) to a COBOL program.

Problem is that the user wants to give the input in excel format , I am stumped as to how to convert an excel file as a readable input to a TN3270 Mainframe system.

Some have suggested to do something called as flat file conversion which I am not sure how to do.

Is there a easier method to extract inputs from an Excel spreadsheet to run a COBOL program on a TN3270 Mainframe.

The below is the screenshot of the tool which is to be converted.

enter image description here

According to my knowledge, we can convert it into a flat file and read the strings using delimiter(|) but I want to know if there is a better way.


Solution

  • You might want to split your task in several steps

    1. Extract data from Excel sheet
    2. Make data available to COBOL program
    3. Work with data in COBOL

    Not knowing the details of your problem I can only suggest solutions at this point:

    1. Use Visual Basic for applications to create a file (you might want to look for a CSV solution and take into account that it might be necessary to change the file encoding)
    2. Use a transfer utility - e.g. ftp or some other mainframe connection that let's you transfer files from the Excel-running computer to the mainframe. Some 3270 terminal software also offers APIs for this.
    3. Convert Excel logic to COBOL (if any)