Eventhough Iam carrying some 8 years of experience on Mainframes behind me Iam totally new to REXX I didn't get a chance to work in REXX
in my prior shops,I had a requirement the requirement would be to build a REXX program which picks up a Cobol Source Program from a flat file
and the REXX program should compile and report all the errors in a report along with the error description just like a Cobol compiler does
So basically you want to build a COBOL compiler which is written in REXX, because your new shop does not have a COBOL compiler or the licence is about to expire, is that true?
But I think you should press for getting the licence renewed instead. Otherwise this will be a futile attempt. I can understand if you want to write a program which does initial check for valid uses of COBOL keywords or a program which can display the incorrect column position per COBOL standard of the shop but would not suggest attempting to write a compiler.
The cobol compiler is just another program like any other so you can allocate the same ddnames you'd use in JCL with the ALLOC TSO command and then call the compiler (IGYCRCTL). One problem you might have is that the compiler may call other programs not in your default search sequence so look at the TSOLIB command to set that up before you enter ISPF or use the LIBDEF ISPLLIB and SELECT CMD() commands to start the compiler.
The other problem you will have is getting detailed context for errors. You can just read the listing for error text but if you want to get more sophisticated and place messages next to the source line that caused each error for example, you can have the compiler generate a SYSADATA file and have Rexx parse that. That is not simple code at all since the SYSADATA is complex but it can be done in a few 10s of lines and has been used to create edit macros and even products that show errors even in nested copybooks.
Thank you all for your quick response Babu after doing some search in various forums available on the web I came across with this REXX script which I believe might meet my requirement I'm pasting it below