Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compiling a COBOL program using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
abhinav343

New User


Joined: 28 May 2007
Posts: 5
Location: punjab

PostPosted: Sun Sep 13, 2009 11:34 am    Post subject: Compiling a COBOL program using REXX
Reply with quote

Hi,

I am trying to create a rexx macro to compile COBOL program. Here it is:

000001 /* REXX */
000002 TRACE I
000003 ADDRESS ISREDIT "MACRO PROCESS"
000004 /*ADDRESS ISREDIT MACRO*/
000005 ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
000006 ADDRESS TSO
000007 "ISREDIT (DSN) = DATASET"
000008 "ISREDIT (MEMB) = MEMBER"
000009 MESSAGE_SETTING = MSG("OFF")
000010 DSN = DSN
000011 MEMB = MEMB
000012 DATASET = "'"DSN"("MEMB")'"
000013 USRID = USERID()
000014 SYSPRINTDSN = MC00.|| USRID ||.SYSPRINT
000015 SYSOUTDSN = MC00.|| USRID ||.SYSOUT
000016 ADDRESS TSO
000017 "FREE F(SYSPRINT SYSIN SYSLIN SYSUT1 SYSUT2 SYSUT3 SYSUT4"
000018 "SYSUT5 SYSUT6 SYSUT7 SYSLIB SYSOUT)"
000019 "ALLOC F(SYSPRINT) DA('"SYSPRINTDSN"') OLD REUSE"
000022 "ALLOC F(SYSIN) DA("DATASET") SHR REUSE"
000023 "ALLOC F(SYSLIN) DA('MC00.RBRYMJB.SYSLIN') OLD REUSE"
000024 "ALLOC F(SYSLMOD) DA('MC00.RBRYMJB.SRCLIB("MEMB")') OLD REUSE"
000025 "ALLOC F(SYSLIB)",
000026 "DA('MZ01U.LC.COPYLIB','M000.LC.COPYLIB') SHR REUSE"
000027 "ALLOC F(SYSOUT) DA('"SYSOUTDSN"') OLD REUSE"
000028 "ALLOC F(SYSUT1) SPACE(5,5) TRACKS UNIT(SYSDA)"
000029 "ALLOC F(SYSUT2) SPACE(5,5) TRACKS UNIT(SYSDA)"
000030 "ALLOC F(SYSUT3) SPACE(5,5) TRACKS UNIT(SYSDA)"
000031 "ALLOC F(SYSUT4) SPACE(5,5) TRACKS UNIT(SYSDA)"
000032 "ALLOC F(SYSUT5) SPACE(5,5) TRACKS UNIT(SYSDA)"
000033 "ALLOC F(SYSUT6) SPACE(5,5) TRACKS UNIT(SYSDA)"
000034 "ALLOC F(SYSUT7) SPACE(5,5) TRACKS UNIT(SYSDA)"
000035 ADDRESS ISPEXEC "SELECT PGM(IGYCRCTL) "||,
000036 "PARM('SOURCE,NOOBJECT,NOSEQ,NOFSRT,NOOFF,MAP,NOOPT')"
000037 /*"CALL 'SYS1.SIGYCOMP(IGYCRCTL)'" */
000038 IF RC<4 THEN
000039 ZEDSMSG = 'COMPILATION SUCCESSFUL'
000040 ELSE
000041 DO
000042 ZEDSMSG = 'COMPILATION FAILED RC='RC
000043 "ISPEXEC BROWSE DATASET('"SYSPRINTDSN"')"
000044 "ISPEXEC SETMSG MSG(ISRZ000)"
000045 RETURN
000046 END
000047 /*"ALLOC F(STEPLIB) DA('D337.GRAL.EJEC') OLD REUSE"
000048 "CALL 'SYS1.LINKLIB(IEWL)'" */
000049 "ALLOC F(SYSLIB) DA('SYS1.SCEELKED') SHR REUSE"
000050 "CALL 'SYS1.LINKLIB(LOADER)'"
000051 IF RC=0 THEN
000052 DO
000053 ZEDSMSG = 'COMPILE & RUN SUCCESSFUL'
000054 "ISPEXEC BROWSE DATASET('"SYSOUTDSN"')"
000055 END
000056 ELSE
000057 DO
000058 ZEDSMSG = 'RUN FAILED RC='RC
000059 "ISPEXEC SETMSG MSG(ISRZ000)"
000060 RETURN
000061 END
000062 "FREE F(SYSPRINT SYSIN SYSLIN SYSUT1 SYSUT2 SYSUT3 SYSUT4",
000063 "SYSUT5 SYSUT6 SYSUT7 SYSLIB SYSOUT)"
000064 "ISPEXEC SETMSG MSG(ISRZ000)"
000065 RETURN

When I am trying to execute this code with trace on I get this:


3 *-* ADDRESS ISREDIT "MACRO PROCESS"
>L> "MACRO PROCESS"
+++ RC(20) +++
5 *-* ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
>L> "CONTROL ERRORS RETURN"
6 *-* ADDRESS TSO
7 *-* "ISREDIT (DSN) = DATASET"
>L> "ISREDIT (DSN) = DATASET"
+++ RC(20) +++
8 *-* "ISREDIT (MEMB) = MEMBER"
>L> "ISREDIT (MEMB) = MEMBER"
+++ RC(20) +++
9 *-* MESSAGE_SETTING = MSG("OFF")
>L> "OFF"
>F> "ON"
10 *-* DSN = DSN
>L> "DSN"
11 *-* MEMB = MEMB
>L> "MEMB"
12 *-* DATASET = "'"DSN"("MEMB")'"
>L> "'"
>V> "DSN"
>O> "'DSN"
>L> "("
>O> "'DSN("
>V> "MEMB"
>O> "'DSN(MEMB"
>L> ")'"
>O> "'DSN(MEMB)'"
13 *-* USRID = USERID()
>F> "RBRYMJB"
14 *-* SYSPRINTDSN = MC00.|| USRID ||.SYSPRINT
>L> "MC00."
>V> "RBRYMJB"
>O> "MC00.RBRYMJB"
>L> ".SYSPRINT"
>O> "MC00.RBRYMJB.SYSPRINT"
15 *-* SYSOUTDSN = MC00.|| USRID ||.SYSOUT
>L> "MC00."
>V> "RBRYMJB"
>O> "MC00.RBRYMJB"
>L> ".SYSOUT"
>O> "MC00.RBRYMJB.SYSOUT"
16 *-* ADDRESS TSO
17 *-* "FREE F(SYSPRINT SYSIN SYSLIN SYSUT1 SYSUT2 SYSUT3 SYSUT4",
"SYSUT5 SYSUT6 SYSUT7 SYSLIB SYSOUT)"
>L> "FREE F(SYSPRINT SYSIN SYSLIN SYSUT1 SYSUT2 SYSUT3 SYSUT4"
>L> "SYSUT5 SYSUT6 SYSUT7 SYSLIB SYSOUT)"
>O> "FREE F(SYSPRINT SYSIN SYSLIN SYSUT1 SYSUT2 SYSUT3 SYSUT4 SYSUT5 S
YSUT6 SYSUT7 SYSLIB SYSOUT)"
+++ RC(12) +++
19 *-* "ALLOC F(SYSPRINT) DA('"SYSPRINTDSN"') OLD REUSE"
>L> "ALLOC F(SYSPRINT) DA('"
>V> "MC00.RBRYMJB.SYSPRINT"
>O> "ALLOC F(SYSPRINT) DA('MC00.RBRYMJB.SYSPRINT"
>L> "') OLD REUSE"
>O> "ALLOC F(SYSPRINT) DA('MC00.RBRYMJB.SYSPRINT') OLD REUSE"
22 *-* "ALLOC F(SYSIN) DA("DATASET") SHR REUSE"
>L> "ALLOC F(SYSIN) DA("
>V> "'DSN(MEMB)'"
>O> "ALLOC F(SYSIN) DA('DSN(MEMB)'"
***
>L> ") SHR REUSE"
>O> "ALLOC F(SYSIN) DA('DSN(MEMB)') SHR REUSE"
+++ RC(12) +++
23 *-* "ALLOC F(SYSLIN) DA('MC00.RBRYMJB.SYSLIN') OLD REUSE"
>L> "ALLOC F(SYSLIN) DA('MC00.RBRYMJB.SYSLIN') OLD REUSE"
24 *-* "ALLOC F(SYSLMOD) DA('MC00.RBRYMJB.SRCLIB("MEMB")') OLD REUSE"
>L> "ALLOC F(SYSLMOD) DA('MC00.RBRYMJB.SRCLIB("
>V> "MEMB"
>O> "ALLOC F(SYSLMOD) DA('MC00.RBRYMJB.SRCLIB(MEMB"
>L> ")') OLD REUSE"
>O> "ALLOC F(SYSLMOD) DA('MC00.RBRYMJB.SRCLIB(MEMB)') OLD REUSE"
25 *-* "ALLOC F(SYSLIB)",
"DA('MZ01U.LC.COPYLIB','M000.LC.COPYLIB') SHR REUSE"
>L> "ALLOC F(SYSLIB)"
>L> "DA('MZ01U.LC.COPYLIB','M000.LC.COPYLIB') SHR REUSE"
>O> "ALLOC F(SYSLIB) DA('MZ01U.LC.COPYLIB','M000.LC.COPYLIB') SHR REUS
E"
27 *-* "ALLOC F(SYSOUT) DA('"SYSOUTDSN"') OLD REUSE"
>L> "ALLOC F(SYSOUT) DA('"
>V> "MC00.RBRYMJB.SYSOUT"
>O> "ALLOC F(SYSOUT) DA('MC00.RBRYMJB.SYSOUT"
>L> "') OLD REUSE"
>O> "ALLOC F(SYSOUT) DA('MC00.RBRYMJB.SYSOUT') OLD REUSE"
28 *-* "ALLOC F(SYSUT1) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT1) SPACE(5,5) TRACKS UNIT(SYSDA)"
29 *-* "ALLOC F(SYSUT2) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT2) SPACE(5,5) TRACKS UNIT(SYSDA)"
30 *-* "ALLOC F(SYSUT3) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT3) SPACE(5,5) TRACKS UNIT(SYSDA)"
31 *-* "ALLOC F(SYSUT4) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT4) SPACE(5,5) TRACKS UNIT(SYSDA)"
32 *-* "ALLOC F(SYSUT5) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT5) SPACE(5,5) TRACKS UNIT(SYSDA)"
33 *-* "ALLOC F(SYSUT6) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT6) SPACE(5,5) TRACKS UNIT(SYSDA)"
34 *-* "ALLOC F(SYSUT7) SPACE(5,5) TRACKS UNIT(SYSDA)"
>L> "ALLOC F(SYSUT7) SPACE(5,5) TRACKS UNIT(SYSDA)"
35 *-* ADDRESS ISPEXEC "SELECT PGM(IGYCRCTL) "||,
"PARM('SOURCE,NOOBJECT,NOSEQ,NOFSRT,NOOFF,MAP,NOOPT')"
>L> "SELECT PGM(IGYCRCTL) "
>L> "PARM('SOURCE,NOOBJECT,NOSEQ,NOFSRT,NOOFF,MAP,NOOPT')"
>O> "SELECT PGM(IGYCRCTL) PARM('SOURCE,NOOBJECT,NOSEQ,NOFSRT,NOOFF,MAP
,NOOPT')"
PDSM15-1 UNABLE TO DETERMINE VERSION INFORMATION FOR MEMBER BEING COMPILED
IEC130I SYSIN DD STATEMENT MISSING
IGYSI5013-U An error occurred while attempting to open
file "SYSIN ".
+++ RC(16) +++
37 *-* /*"CALL 'SYS1.SIGYCOMP(IGYCRCTL)'" */
38 *-* IF RC<4
>V> "16"
>L> "4"
>O> "0"
40 *-* ELSE
41 *-* DO
42 *-* ZEDSMSG = 'COMPILATION FAILED RC='RC
>L> "COMPILATION FAILED RC="
>V> "16"
>O> "COMPILATION FAILED RC=16"
43 *-* "ISPEXEC BROWSE DATASET('"SYSPRINTDSN"')"
>L> "ISPEXEC BROWSE DATASET('"
>V> "MC00.RBRYMJB.SYSPRINT"
>O> "ISPEXEC BROWSE DATASET('MC00.RBRYMJB.SYSPRINT"
>L> "')"
>O> "ISPEXEC BROWSE DATASET('MC00.RBRYMJB.SYSPRINT')"



Could you please get me some clue on this, what is wrong that I am doing?
Back to top
View user's profile Send private message

parsesource

New User


Joined: 06 Feb 2006
Posts: 97

PostPosted: Sun Sep 13, 2009 3:56 pm    Post subject: Reply to: Compiling a COBOL program using REXX
Reply with quote

1) i guess you execute this rexx edit macro with TSO rexxname, hence ADDRESS ISREDIT "MACRO PROCESS" Return RC=20. execute it without 'TSO'

2) i think an ADDRESS TSO "ISREDIT ...." does not work. use ADDRESS ISREDIT "....." instead.
ISPF commands can be exectuted with ADDRESS TSO "ISPEXEC ..... ", but it´s not recommended to it this way.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 14, 2009 5:03 am    Post subject:
Reply with quote

Hello,

You should only use the system standard method(s) to compile programs for use on that system. People should not create their own compile jcl.

A few places i've supported make this a condition of continued employment (i.e. use the standard tools or be terminated).

Why do you believe it is allright to create some non-standard compile process?
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Mon Sep 14, 2009 2:20 pm    Post subject:
Reply with quote

dick scherrer wrote:
You should only use the system standard method(s) to compile programs for use on that system. People should not create their own compile jcl.

A few places I've supported make this a condition of continued employment (i.e. use the standard tools or be terminated).

If those were the rules, I'd would not even want to work at such a place! icon_evil.gif

dick scherrer wrote:
Why do you believe it is all right to create some non-standard compile process?

Because you don't want to go through all the hoops (of ChangeMan, SCLM, etc) if all you need is a bit of test JCL to compile, link and run small test-cases.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 14, 2009 7:15 pm    Post subject:
Reply with quote

Hello,

Quote:
Because you don't want to go through all the hoops (of ChangeMan, SCLM, etc) if all you need is a bit of test JCL to compile, link and run small test-cases.
The very reason the standards were put in place. . .

Quote:
if all you need is a bit of test JCL to compile, link and run small test-cases.
As one who created standard compile jcl in a few prior lives, there is no reason that the small test case needs to be tedious. On most of my systems, people entered a script name and a module name and that was all. I suggest personally generated rexx/jcl/whatever will not require less effort to get the compile done. . .

Some people simply don't like standards - they believe it interferes with their creativity. To use your term - bullthis. . . icon_wink.gif Creativity should be spent solving the client/user requirements, not getting around the standards. . .

imho. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us