Hi everyone,
I am looking for a sample JCL that compiles and link two assembler programs.
The first assembler defines a V-type constant as shown below:
ENTRY MSG1,MSG2
.
.
.
MSG1 DC CL15'*HELLO WORLD1 *'
MSG2 DC CL15'*HELLO WORLD2 *'
The second program accesses the vcons variables in the manner shown below:
L R2,=V(MSG1)
ST R2,MSGADDR
WTO MF=(E,WTOBLOCK)
LTR R15,R15
BNZ ABENDX
*
***DISPLAY ADDRESS OF MSG2***
*
L R2,=V(MSG2)
ST R2,MSGADDR
MVI WTOMSG+14,C'2'
WTO MF=(E,WTOBLOCK)
LTR R15,R15
BNZ ABENDX
Thanks in advance!!!
Assembler Compiler JCL - asm with v-type constants
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Assembler Compiler JCL - asm with v-type constants
By itself, the topic title mentions 2 issues.
- What is the JCL used to assemble and link two Assembler programs?
This forum cannot provide a proper answer to this question. Every installation has its own standards, and you should follow that installations standards. In the 40+ years I've been writing Assembler programs I have used at least 6 different programs to assemble programs. Each program has its own requirements, and every installation may impose additional standards. - What is the proper way to define external symbols in one module and access the data in a second statically linked module?
There are many issues here; I have reduced the issues somewhat by the way I have worded the bullet topic. You should carefully study the ENTRY and EXTRN Assembler instructions in HLASM V1R6 Language Ref. These instructions have been essentially the same for every Assembler program I have used for OS/360 and its derivative operating systems.
The V-type address constant sort of combines the EXTRN Assembler instruction and an A-type address constant, but it should only be used to provide the address of an external symbol that defines an executable program. In some infrequently encountered situations a V-type address constant used to access data will point to junk.
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: Assembler Compiler JCL - asm with v-type constants
This is correct.
The "main" programThe data module
Sample JCL to assemble, link, and run the modules. The modules are in a PDS in my userid.JCL like this will work in many installations, but it will almost certainly violate coding standards in most installations.
Notes.
The "main" program
Code: Select all
EXWTO CSECT
USING *,12
SAVE (14,12),,*
LR 12,15
L 1,=V(WTO1)
WTO MF=(E,(1))
L 1,=V(WTO2)
WTO MF=(E,(1))
RETURN (14,12),T,RC=0
LTORG ,
END EXWTO
Code: Select all
WTODATA CSECT
ENTRY WTO1,WTO2
WTO1 WTO 'FIRST WTO MACRO',MF=L,ROUTCDE=11,DESC=7
WTO2 WTO 'SECOND WTO MACRO',MF=L,ROUTCDE=11,DESC=7
END ,
Sample JCL to assemble, link, and run the modules. The modules are in a PDS in my userid.
Code: Select all
//EXWTO EXEC HLASMC
//SYSLIN DD DSN=&&EXWTO
//SYSIN DD DISP=SHR,
// DSN=&SYSUID..LINKMOD.ASM(EXWTO)
//WTODATA EXEC HLASMC
//SYSLIN DD DSN=&&WTODATA
//SYSIN DD DISP=SHR,
// DSN=&SYSUID..LINKMOD.ASM(WTODATA)
//LINK EXEC PGM=IEWL,PARM='MAP,LIST'
//SYSPRINT DD SYSOUT=*
//SYSLMOD DD DISP=(,PASS),UNIT=SYSDA,
// SPACE=(CYL,(1,1,1)),DSN=&&G(G)
//EXWTO DD DISP=(OLD,DELETE),
// DSN=&&EXWTO
//WTODATA DD DISP=(OLD,DELETE),
// DSN=&&WTODATA
//SYSLIN DD *
INCLUDE EXWTO,WTODATA
//RUN EXEC PGM=*.LINK.SYSLMOD
//SYSUDUMP DD SYSOUT=*
Notes.
- The "main" program does not prepare a new save area because it does not call any subroutines. WTO is a system service invoked by an SVC instruction. The system code invoked by the SVC instruction preserves your registers in the system; it does not use or require the register save area whose address is in register 13.
- A plain WTO macro (e.g. WTO 'THIS IS A WTO MACRO') prepares a parameter list that includes the message and invokes the system WTO service. The "execute" form of a WTO macro (e.g. WTO MF=(E,PARMLIST) ) load the address of a WTO parameter list and invokes the system WTO service. The "list" form of a WTO macro (e.g., PARMLIST WTO 'THIS IS A WTO MACRO',MF=L prepares the parameter list with a fixed message. A programmer that knows the parameter list can prepare a parameter list with a message containing variable data and use the "execute" form of the WTO macro to write the message.
- The first and second steps overrides the data set name specified in the SYSLIN DD statement in the HLASMC cataloged procedure. The LINK step, which uses the Binder, which does not normally require a SYSUT1 DD statement, and creates load module G in temporary data set &&G. The RUN step executes the load module created by the LINK step. The LINK and RUN steps are typical of RYO (Roll Your Own) JCL.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 4
- 3233
-
by prino
View the latest post
Tue Nov 24, 2020 6:12 pm
-
-
Compiler option INVDATA is not working on COBOL6.3
by Misha786 » Fri Apr 22, 2022 5:35 pm » in IBM Cobol - 4
- 3403
-
by Misha786
View the latest post
Mon Apr 25, 2022 4:35 pm
-
-
-
Assembler program accessing IMS DB Database
by gschhatwal1176 » Sat Aug 08, 2020 12:34 pm » in Assembler - 5
- 14551
-
by NicC
View the latest post
Sun Aug 09, 2020 2:53 am
-
-
-
how to decompress DB2 SMF records in assembler program
by chaat » Fri Feb 19, 2021 9:53 am » in Assembler - 3
- 3504
-
by willy jensen
View the latest post
Sun Feb 21, 2021 4:26 pm
-