<p>We maintain a system that has over a million lines of COBOL code. Does someone have suggestions about how to migrate to a GUI (probably Windows based) without losing all the business logic we have written in COBOL? And yes, some of the business logic is buried inside the current user interface.</p>

[{'answer_id': 47158, 'author': 'Mark Nold', 'author_id': 4134, 'author_profile': 'https://Stackoverflow.com/users/4134', 'pm_score': 1, 'selected': False, 'text': '<p>Writing a <a href="http://en.wikipedia.org/wiki/Screen_scraping" rel="nofollow noreferrer">screen scraper</a> is probably your best bet. Some of the major ERP systems have done this for years during a transition from server based apps to 3-tier applications. One i have worked with had loads of interesting features such as drop down lists for regularly used fields, date pop ups and even client based macro languages based on the scraping input.</p>\n\n<p>These weren\'t great but worked well for the clients and made sure the applications still worked in a reliable fashion.</p>\n\n<p>There is a lot of different ways to put this together, but if you put some thought into it you could probably use java or .net to create a desktop based application and with a little extra effort make a web based implementation. </p>\n'}, {'answer_id': 47180, 'author': 'bruceatk', 'author_id': 791, 'author_profile': 'https://Stackoverflow.com/users/791', 'pm_score': 2, 'selected': False, 'text': '<p>If it was me I would look into something like this:</p>\n\n<p><a href="http://www.adtools.com/products/windows/cobol.htm" rel="nofollow noreferrer">NetCobol for Windows</a></p>\n\n<p>It should be fairly easy to wrap your COBOL with an interface  that exposes the functionality (if it isn\'t already written that way) and then call it from a .NET application.</p>\n\n<p>It took us about 15 years to get off of our mainframe, because we didn\'t do something like this.</p>\n'}, {'answer_id': 244815, 'author': 'rbrayb', 'author_id': 9922, 'author_profile': 'https://Stackoverflow.com/users/9922', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.microfocus.com/" rel="nofollow noreferrer">Microfocus</a> provide a tool called Enterprise Server which allows COBOL to interact with web services.</p>\n\n<p>If you have a COBOL program A and another COBOL program B and A calls B via the interface section, the tool allows you to expose B\'s interface section as a web service.</p>\n\n<p>For program A, you then generate a client proxy and A can now call B via a web service.</p>\n\n<p>Of course, because B now has a web service any other type of program (command line, Windows application, Java, ASP etc.) can now also call it.</p>\n\n<p>Using this approach, you can "nibble away at the edges" to move the GUI to a modern, browser based approach using something like ASP while still utilising the COBOL business engine.</p>\n\n<p>And once you have a decent set of web services, these can be used for any new development which provides a way of moving away from COBOL in the longer term.</p>\n'}, {'answer_id': 2425466, 'author': 'crowne', 'author_id': 97745, 'author_profile': 'https://Stackoverflow.com/users/97745', 'pm_score': 0, 'selected': False, 'text': '<p>You could use an <a href="http://en.wikipedia.org/wiki/Enterprise_service_bus" rel="nofollow noreferrer">ESB</a> to expose the back-end legacy services, and then code your GUI to invoke the services via the ESB.  </p>\n\n<p>Then you can begin replacing the legacy services with implementations on your new platform of choice.<br>\nThe GUI need not be aware of the cut-over of back-end service implementation, as long as the interface to the service does not change - minor changes may hidden from the GUI by the ESB.</p>\n\n<p>Business logic that resides in the legacy user interface layer will need to be refactored by extracting the business logic and exposing it as new services on the new platform to be consumed by the new GUI via the ESB.</p>\n\n<p>As for the choice of platform for the new GUI, why not consider a web-based UI rather than a native windows platform, then at least updates to the UI will only need to be applied to the web-server rather than having to roll-out changes to each individual work-station.</p>\n'}]
['https://Stackoverflow.com/questions/47133', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3749/']