I have to compile a specific assembler code:
ADD TITLE 'contest program'
ADD CSECT
ADD AMODE 31
ADD RMODE 24
*
*--------------------------------------------------------------------*
* *
* register equates *
* *
*--------------------------------------------------------------------*
*
R0 EQU 0 register 0
R1 EQU 1 register 1
R2 EQU 2 register 2
R3 EQU 3 register 3
R4 EQU 4 register 4
R5 EQU 5 register 5
R6 EQU 6 register 6
R7 EQU 7 register 7
R8 EQU 8 register 8
R9 EQU 9 register 9
R10 EQU 10 register 10
R11 EQU 11 register 11
BASEREG EQU 12 base register
SAVEREG EQU 13 save area register
RETREG EQU 14 caller's return address
ENTRYREG EQU 15 entry address
RETCODE EQU 15 return code
EJECT
*
*--------------------------------------------------------------------*
* *
* standard entry setup, save area chaining, establish *
* base register and addressibility *
* *
*--------------------------------------------------------------------*
*
USING ADD,ENTRYREG establish addressibility
B SETUP branch around eyecatcher
DC CL8'ADD' program name
DC CL8'&SYSDATE' program assembled date
SETUP STM RETREG,BASEREG,12(SAVEREG) save caller's registers
BALR BASEREG,R0 establish base register
DROP ENTRYREG drop initial base register
USING *,BASEREG establish addressibilty
LA ENTRYREG,SAVEAREA point to this program save area
ST SAVEREG,4(,ENTRYREG) save address of caller's save
* area
ST ENTRYREG,8(,SAVEREG) save address of this program
* save area
LR SAVEREG,ENTRYREG point to this program savearea
EJECT
*
*--------------------------------------------------------------------*
* *
* program body *
* *
*--------------------------------------------------------------------*
LOOPINIT DS 0H
OPEN (PRTLINE,OUTPUT)
MVC LINE+1(77),STATLIN
L R2,COUNTER
*
LOOP DS 0H
*
ED OUT,TOT
MVC LINE+77(6),OUT
PUT PRTLINE,LINE
MVC OUT,=X'402020202020'
AP TOT,ONE
*
BCT 2,LOOP
*
CLOSE (PRTLINE)
*
*--------------------------------------------------------------------*
* *
* standard exit - restore caller's registers and *
* return to caller *
* *
*--------------------------------------------------------------------*
*
EXIT DS 0H halfword boundary alignment
L SAVEREG,4(,SAVEREG) restore caller's save area addr
L RETREG,12(,SAVEREG) restore return address register
LM R0,BASEREG,20(SAVEREG) restore all regs. except reg15
BR RETREG return to caller
EJECT
*
*--------------------------------------------------------------------*
* *
* storage and constant definitions. *
* print output definition. *
* *
*--------------------------------------------------------------------*
*
STATLIN DS 0CL77
DC C'WELCOME TO THE MAINFRAME CHALLENGE!! '
DC C'THIS IS THE CONTENT OF YOUR TOT COUNTER '
*
LINE DS 0CL81
DC C' '
DS CL80
PRTLINE DCB DSORG=PS,DDNAME=PRTLINE,MACRF=PM, X
RECFM=FA,LRECL=83,BLKSIZE=83
ONE DC P'01'
TOT DC PL3'1000'
OUT DC X'402020202020'
SAVEAREA DC 18F'-1' register save area
COUNTER DC F'9001'
END ADD
ADD CSECT
ADD AMODE 31
ADD RMODE 24
*
*--------------------------------------------------------------------*
* *
* register equates *
* *
*--------------------------------------------------------------------*
*
R0 EQU 0 register 0
R1 EQU 1 register 1
R2 EQU 2 register 2
R3 EQU 3 register 3
R4 EQU 4 register 4
R5 EQU 5 register 5
R6 EQU 6 register 6
R7 EQU 7 register 7
R8 EQU 8 register 8
R9 EQU 9 register 9
R10 EQU 10 register 10
R11 EQU 11 register 11
BASEREG EQU 12 base register
SAVEREG EQU 13 save area register
RETREG EQU 14 caller's return address
ENTRYREG EQU 15 entry address
RETCODE EQU 15 return code
EJECT
*
*--------------------------------------------------------------------*
* *
* standard entry setup, save area chaining, establish *
* base register and addressibility *
* *
*--------------------------------------------------------------------*
*
USING ADD,ENTRYREG establish addressibility
B SETUP branch around eyecatcher
DC CL8'ADD' program name
DC CL8'&SYSDATE' program assembled date
SETUP STM RETREG,BASEREG,12(SAVEREG) save caller's registers
BALR BASEREG,R0 establish base register
DROP ENTRYREG drop initial base register
USING *,BASEREG establish addressibilty
LA ENTRYREG,SAVEAREA point to this program save area
ST SAVEREG,4(,ENTRYREG) save address of caller's save
* area
ST ENTRYREG,8(,SAVEREG) save address of this program
* save area
LR SAVEREG,ENTRYREG point to this program savearea
EJECT
*
*--------------------------------------------------------------------*
* *
* program body *
* *
*--------------------------------------------------------------------*
LOOPINIT DS 0H
OPEN (PRTLINE,OUTPUT)
MVC LINE+1(77),STATLIN
L R2,COUNTER
*
LOOP DS 0H
*
ED OUT,TOT
MVC LINE+77(6),OUT
PUT PRTLINE,LINE
MVC OUT,=X'402020202020'
AP TOT,ONE
*
BCT 2,LOOP
*
CLOSE (PRTLINE)
*
*--------------------------------------------------------------------*
* *
* standard exit - restore caller's registers and *
* return to caller *
* *
*--------------------------------------------------------------------*
*
EXIT DS 0H halfword boundary alignment
L SAVEREG,4(,SAVEREG) restore caller's save area addr
L RETREG,12(,SAVEREG) restore return address register
LM R0,BASEREG,20(SAVEREG) restore all regs. except reg15
BR RETREG return to caller
EJECT
*
*--------------------------------------------------------------------*
* *
* storage and constant definitions. *
* print output definition. *
* *
*--------------------------------------------------------------------*
*
STATLIN DS 0CL77
DC C'WELCOME TO THE MAINFRAME CHALLENGE!! '
DC C'THIS IS THE CONTENT OF YOUR TOT COUNTER '
*
LINE DS 0CL81
DC C' '
DS CL80
PRTLINE DCB DSORG=PS,DDNAME=PRTLINE,MACRF=PM, X
RECFM=FA,LRECL=83,BLKSIZE=83
ONE DC P'01'
TOT DC PL3'1000'
OUT DC X'402020202020'
SAVEAREA DC 18F'-1' register save area
COUNTER DC F'9001'
END ADD
Using this JCL.:
//ADD JOB 1,NOTIFY=&SYSUID,MSGCLASS=H
//**************************************************
//* COMPILE ASSEMBLER PROGRAM
//**************************************************
//STEP1 EXEC HLASMCL
//C.SYSIN DD DSN=ZOS.CONTEST(ASM010),DISP=SHR
//L.SYSLMOD DD DSN=ZCON039.PART3.LOAD(ADD),DISP=SHR
// IF RC = 0 THEN
//STEP2 EXEC PGM=ADD
//STEPLIB DD DSN=ZCON039.PART3.LOAD,DISP=SHR
//PRTLINE DD SYSOUT=*
// ELSE
// ENDIF
//**************************************************
//* COMPILE ASSEMBLER PROGRAM
//**************************************************
//STEP1 EXEC HLASMCL
//C.SYSIN DD DSN=ZOS.CONTEST(ASM010),DISP=SHR
//L.SYSLMOD DD DSN=ZCON039.PART3.LOAD(ADD),DISP=SHR
// IF RC = 0 THEN
//STEP2 EXEC PGM=ADD
//STEPLIB DD DSN=ZCON039.PART3.LOAD,DISP=SHR
//PRTLINE DD SYSOUT=*
// ELSE
// ENDIF
I already made the necessary fixes to the code, I had to optimize it to use less system resources and modify it to count from 1000 to 10000. However, when submitting the compiling job, I get this output and an error.:
1 J E S 2 J O B L O G -- S Y S T E M M V S T -- N O D E T S T M V S 0 1
0
20.56.49 JOB08432 ---- FRIDAY, 14 NOV 2008 ----
20.56.49 JOB08432 IRR010I USERID ZCON039 IS ASSIGNED TO THIS JOB.
20.56.49 JOB08432 IEF677I WARNING MESSAGE(S) FOR JOB ADD ISSUED
20.56.49 JOB08432 ICH70001I ZCON039 LAST ACCESS AT 20:25:24 ON FRIDAY, NOVEMBER 14, 2008
20.56.49 JOB08432 $HASP373 ADD STARTED - INIT 1 - CLASS A - SYS MVST
20.56.49 JOB08432 - --TIMINGS (MINS.)-- ----PAGING COUNTS---
20.56.49 JOB08432 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK SERV PG PAGE SWAP VIO SWAPS STEPNO
20.56.49 JOB08432 -ADD STEP1 C FLUSH 0 .00 .00 .00 0 0 0 0 0 0 1
20.56.49 JOB08432 IEF453I ADD - JOB FAILED - JCL ERROR
20.56.49 JOB08432 -ADD ENDED. NAME- TOTAL CPU TIME= .00 TOTAL ELAPSED TIME= .00
20.56.49 JOB08432 -NOT_EXECUTED_STEP_TABLE BEGIN
20.56.49 JOB08432 -JOBNAME STEPNAME PROCSTEP STEPNO
20.56.49 JOB08432 -ADD STEP1 C 1
20.56.49 JOB08432 -ADD STEP1 L 2
20.56.49 JOB08432 -ADD STEP2 3
20.56.49 JOB08432 -NOT_EXECUTED_STEP_TABLE END
20.56.49 JOB08432 $HASP395 ADD ENDED
0------ JES2 JOB STATISTICS ------
- 14 NOV 2008 JOB EXECUTION DATE
- 13 CARDS READ
- 91 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 7 SYSOUT SPOOL KBYTES
- 0.00 MINUTES EXECUTION TIME
!! END OF JES SPOOL FILE !!
1 //ADD JOB 1,NOTIFY=&SYSUID,MSGCLASS=H JOB08432
//**************************************************
//* COMPILE ASSEMBLER PROGRAM
//**************************************************
IEFC653I SUBSTITUTION JCL - 1,NOTIFY=ZCON039,MSGCLASS=H
2 //STEP1 EXEC HLASMCL
3 XXASMACL PROC 00001000
XX* 00002000
XX******************************************************************** 00003000
XX* Licensed Materials - Property of IBM * 00004000
XX* * 00005000
XX* 5696-234 * 00006000
XX* * 00007000
XX* (c) Copyright IBM Corp. 1992, 1998. All Rights Reserved. * 00008000
XX* * 00009000
XX* US Government Users Restricted Rights - Use, * 00010000
XX* duplication or disclosure restricted by GSA ADP * 00011000
XX* Schedule Contract with IBM Corp. * 00012000
XX* * 00013000
XX******************************************************************** 00014000
XX* * 00015000
XX* ASMACL * 00016000
XX* * 00017000
XX* THIS PROCEDURE RUNS THE HIGH LEVEL ASSEMBLER, LINK-EDITS THE * 00018000
XX* NEWLY ASSEMBLED PROGRAM. * 00019000
XX* * 00020000
XX******************************************************************** 00021000
XX* 00022000
4 XXC EXEC PGM=ASMA90 00023000
5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 00024000
6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), 00025000
XX UNIT=SYSALLDA,DCB=BUFNO=1 00026000
7 XXSYSPRINT DD SYSOUT=* 00027000
8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), 00028000
XX UNIT=SYSALLDA,DISP=(MOD,PASS), 00029000
XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 00030000
9 //C.SYSIN DD DSN=ZCON039.ANSWERS(ASM010),DISP=SHR
10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST,NCAL',COND=(8,LT,C) 00031000
11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 00032000
12 XX DD DDNAME=SYSIN 00033000
13 //L.SYSLMOD DD DSN=ZCON039.PART3.LOAD(ADD),DISP=SHR
X/SYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), 00034000
X/ DSN=&&GOSET(GO) 00035000
14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), 00036000
XX UNIT=SYSALLDA,DCB=BUFNO=1 00037000
15 XXSYSPRINT DD SYSOUT=* 00038000
16 // IF RC = 0 THEN
17 //STEP2 EXEC PGM=ADD
18 //STEPLIB DD DSN=ZCON039.PART3.LOAD,DISP=SHR
19 //PRTLINE DD SYSOUT=*
20 // ELSE
21 // ENDIF
!! END OF JES SPOOL FILE !!
STMT NO. MESSAGE
2 IEFC001I PROCEDURE HLASMCL WAS EXPANDED USING SYSTEM LIBRARY CENTER.PROCLIB
17 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
6 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
8 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
14 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
ICH70001I ZCON039 LAST ACCESS AT 20:25:24 ON FRIDAY, NOVEMBER 14, 2008
IEF212I ADD C STEP1 SYSIN - DATA SET NOT FOUND
IEF272I ADD C STEP1 - STEP WAS NOT EXECUTED.
IEF373I STEP/C /START 2008319.2056
IEF374I STEP/C /STOP 2008319.2056 CPU 0MIN 00.00SEC SRB 0MIN 00.00SEC VIRT 0K SYS 0K EXT 0K SYS 0K
IEF375I JOB/ADD /START 2008319.2056
IEF376I JOB/ADD /STOP 2008319.2056 CPU 0MIN 00.00SEC SRB 0MIN 00.00SEC
!! END OF JES SPOOL FILE !!
0
20.56.49 JOB08432 ---- FRIDAY, 14 NOV 2008 ----
20.56.49 JOB08432 IRR010I USERID ZCON039 IS ASSIGNED TO THIS JOB.
20.56.49 JOB08432 IEF677I WARNING MESSAGE(S) FOR JOB ADD ISSUED
20.56.49 JOB08432 ICH70001I ZCON039 LAST ACCESS AT 20:25:24 ON FRIDAY, NOVEMBER 14, 2008
20.56.49 JOB08432 $HASP373 ADD STARTED - INIT 1 - CLASS A - SYS MVST
20.56.49 JOB08432 - --TIMINGS (MINS.)-- ----PAGING COUNTS---
20.56.49 JOB08432 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK SERV PG PAGE SWAP VIO SWAPS STEPNO
20.56.49 JOB08432 -ADD STEP1 C FLUSH 0 .00 .00 .00 0 0 0 0 0 0 1
20.56.49 JOB08432 IEF453I ADD - JOB FAILED - JCL ERROR
20.56.49 JOB08432 -ADD ENDED. NAME- TOTAL CPU TIME= .00 TOTAL ELAPSED TIME= .00
20.56.49 JOB08432 -NOT_EXECUTED_STEP_TABLE BEGIN
20.56.49 JOB08432 -JOBNAME STEPNAME PROCSTEP STEPNO
20.56.49 JOB08432 -ADD STEP1 C 1
20.56.49 JOB08432 -ADD STEP1 L 2
20.56.49 JOB08432 -ADD STEP2 3
20.56.49 JOB08432 -NOT_EXECUTED_STEP_TABLE END
20.56.49 JOB08432 $HASP395 ADD ENDED
0------ JES2 JOB STATISTICS ------
- 14 NOV 2008 JOB EXECUTION DATE
- 13 CARDS READ
- 91 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 7 SYSOUT SPOOL KBYTES
- 0.00 MINUTES EXECUTION TIME
!! END OF JES SPOOL FILE !!
1 //ADD JOB 1,NOTIFY=&SYSUID,MSGCLASS=H JOB08432
//**************************************************
//* COMPILE ASSEMBLER PROGRAM
//**************************************************
IEFC653I SUBSTITUTION JCL - 1,NOTIFY=ZCON039,MSGCLASS=H
2 //STEP1 EXEC HLASMCL
3 XXASMACL PROC 00001000
XX* 00002000
XX******************************************************************** 00003000
XX* Licensed Materials - Property of IBM * 00004000
XX* * 00005000
XX* 5696-234 * 00006000
XX* * 00007000
XX* (c) Copyright IBM Corp. 1992, 1998. All Rights Reserved. * 00008000
XX* * 00009000
XX* US Government Users Restricted Rights - Use, * 00010000
XX* duplication or disclosure restricted by GSA ADP * 00011000
XX* Schedule Contract with IBM Corp. * 00012000
XX* * 00013000
XX******************************************************************** 00014000
XX* * 00015000
XX* ASMACL * 00016000
XX* * 00017000
XX* THIS PROCEDURE RUNS THE HIGH LEVEL ASSEMBLER, LINK-EDITS THE * 00018000
XX* NEWLY ASSEMBLED PROGRAM. * 00019000
XX* * 00020000
XX******************************************************************** 00021000
XX* 00022000
4 XXC EXEC PGM=ASMA90 00023000
5 XXSYSLIB DD DSN=SYS1.MACLIB,DISP=SHR 00024000
6 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND), 00025000
XX UNIT=SYSALLDA,DCB=BUFNO=1 00026000
7 XXSYSPRINT DD SYSOUT=* 00027000
8 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND), 00028000
XX UNIT=SYSALLDA,DISP=(MOD,PASS), 00029000
XX DCB=(BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1) 00030000
9 //C.SYSIN DD DSN=ZCON039.ANSWERS(ASM010),DISP=SHR
10 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST,NCAL',COND=(8,LT,C) 00031000
11 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE) 00032000
12 XX DD DDNAME=SYSIN 00033000
13 //L.SYSLMOD DD DSN=ZCON039.PART3.LOAD(ADD),DISP=SHR
X/SYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)), 00034000
X/ DSN=&&GOSET(GO) 00035000
14 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND), 00036000
XX UNIT=SYSALLDA,DCB=BUFNO=1 00037000
15 XXSYSPRINT DD SYSOUT=* 00038000
16 // IF RC = 0 THEN
17 //STEP2 EXEC PGM=ADD
18 //STEPLIB DD DSN=ZCON039.PART3.LOAD,DISP=SHR
19 //PRTLINE DD SYSOUT=*
20 // ELSE
21 // ENDIF
!! END OF JES SPOOL FILE !!
STMT NO. MESSAGE
2 IEFC001I PROCEDURE HLASMCL WAS EXPANDED USING SYSTEM LIBRARY CENTER.PROCLIB
17 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
6 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
8 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
14 IGD01005I STORAGE CLASS INSTALLATION EXIT ENTERED
ICH70001I ZCON039 LAST ACCESS AT 20:25:24 ON FRIDAY, NOVEMBER 14, 2008
IEF212I ADD C STEP1 SYSIN - DATA SET NOT FOUND
IEF272I ADD C STEP1 - STEP WAS NOT EXECUTED.
IEF373I STEP/C /START 2008319.2056
IEF374I STEP/C /STOP 2008319.2056 CPU 0MIN 00.00SEC SRB 0MIN 00.00SEC VIRT 0K SYS 0K EXT 0K SYS 0K
IEF375I JOB/ADD /START 2008319.2056
IEF376I JOB/ADD /STOP 2008319.2056 CPU 0MIN 00.00SEC SRB 0MIN 00.00SEC
!! END OF JES SPOOL FILE !!
Could anybody drop me some help? >_> I'd also appreciate if somebody more experienced took a look at the code and see if everything is OK with it, as I don't have much experience in Assembler Coding
Thanks in advance,
[]'s!