View previous topic :: View next topic
|
Author |
Message |
sreekanth_pen Currently Banned New User
Joined: 16 May 2007 Posts: 4 Location: hyderabad
|
|
|
|
Hi All
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
Thanks a tonne to all in anticipation
Sreekanth |
|
Back to top |
|
|
dharmendra_kp
New User
Joined: 10 Mar 2005 Posts: 33 Location: Lewiston
|
|
|
|
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. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well you can invoke the COBOL compiler using REXX, so why not do that. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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. |
|
Back to top |
|
|
sreekanth_pen Currently Banned New User
Joined: 16 May 2007 Posts: 4 Location: hyderabad
|
|
|
|
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
Code: |
Address TSO
"ALLOC SHR REU F(SYSLIB) DA('"dataset"'" copybook_libraries ")
"ALLOC NEW REU F(SYSPRINT) UNIT(VIO) DSO(PS) SP(10,10) CYL",
"DSO(PS) RECFM(V B) LREC(32760) BLKSIZE(0)"
"ALLOC OLD REU F(SYSLIN) DUMMY REU"
"ALLOC SHR REU F(SYSIN) DA('"dataset"("mem")'"
Do a = 1 to 7
"ALLOC NEW REU F(SYSUT"a") UNIT(VIO) DSO(PS) SP(10,10) CYL"
End
Address tso "ALLOC SHR REU F(AACMLLBS) DA("compierloads")"
Address ispexec "LIBDEF ISPLLIB EXCLLIBR ID(AACMLLBS)"
tsocmd= "CALL *("compiler_load_nameb") '"compiler_parameters"'"
ispfcmd = "SELECT CMD(" || tsocmd || ')'
Address ispexec ispfcmd
cobrc = rc
address ispexec "LIBDEF ISPLLIB"
"FREE F(AACMLLBS)"
|
|
|
Back to top |
|
|
|