z390 Mainframe Assembly Code Programming

Note: school related.

Can you explain how to remove the errors necessary to complete the first assignment in the pdf?

In particular, the parser starts out by giving an error having to do with a lack of an end statement.

I'm using the z390 Portable Mainframe Assembler and Emulator (http://www.z390.org/).
prog41.mlc
        TITLE 'CS 4321 Program #4 by J. Colt Wright' 
        PRINT NOGEN    
COPY          SUBENTRY
              SUBEXIT
INFILE  DCB   DDNAME=PROG41.MLC,    X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=72,         X
              EODAD=EOF,        X
              MACRF=GM          X
*
OUTFILE DCB   DDNAME=COPY.TXT,   X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=80,         X
              MACRF=PM          X
*
IRECORD DC    CL72' '
ORECORD DC    CL80' '

prog4.mlc
        TITLE 'CS 4321 Program #4 by J. Colt Wright' 
        PRINT NOGEN    
COPY          SUBENTRY
              SUBEXIT
INFILE  DCB   DDNAME=PROG4.MLC,    X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=72,         X
              EODAD=EOF,        X
              MACRF=GM          X
*
OUTFILE DCB   DDNAME=COPY.TXT,   X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=80,         X
              MACRF=PM          X
*
IRECORD DC    CL72' '
ORECORD DC    CL80' '

Open in new window

Sessions5and6.pdf
JCW2Asked:
Who is Participating?
 
eagerCommented:
If you are having a problem with an assignment, ask your instructor.  

Where it says "program to be added" on slide 14, what do YOU think it means?  What did your instructor say?
0
 
eagerCommented:
You don't tell us what error messages you receive.

It's been forever since I last wrote S/360 assembly.  Have you tried adding an "END" statement at the end of the file?  Be sure to leave (at least) the first column blank.
0
 
JCW2Author Commented:
If I use

TITLE 'PROGRAM 4 80/80 LISTING'
PRINT NOGEN
COPY SUBENTRY
WTO 'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
OPEN (INFILE,INPUT)
OPEN (OUTFILE,OUTPUT)
WTO 'Files opened successfully'
*
LOOP EQU *
GET INFILE,IRECORD
MVC ORECORD,=CL133' '
MVC ORECORD(80),IRECORD
PUT OUTFILE,ORECORD
B LOOP
*
EOF EQU *
CLOSE (INFILE,,OUTFILE)
WTO 'PROG4 ENDED OK'
SUBEXIT



00:33:19 PROG4b    MZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_26 10/08/11
00:33:19 PROG4b    MZ390 MNOTE 4,'missing END statement'
00:33:19 PROG4b    AZ390 AZ390E error  29         (1/1)1   TITLE 'PROGRAM 4 80/80 LISTING'
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = 'PROGRAM
00:33:19 PROG4b    AZ390 AZ390E error  29         (1/2)2   PRINT NOGEN
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = NOGEN
00:33:19 PROG4b    AZ390 AZ390E error  29        (1/4)16   WTO 'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = 'PROG4
00:33:19 PROG4b    AZ390 AZ390E error  29        (1/5)17   OPEN (INFILE,INPUT)
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = (INFILE,INPUT)
00:33:19 PROG4b    AZ390 AZ390E error  29        (1/6)18   OPEN (OUTFILE,OUTPUT)
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = (OUTFILE,OUTPUT)
00:33:19 PROG4b    AZ390 AZ390E error  29        (1/7)19   WTO 'FILES opened successfully'
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = 'FILES
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/10)22   GET INFILE,IRECORD
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = INFILE,IRECORD
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/11)23   MVC ORECORD,=CL133' '
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = ORECORD,=CL133'
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/12)24   MVC ORECORD(80),IRECORD
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = ORECORD(80),IRECORD
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/13)25   PUT OUTFILE,ORECORD
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = OUTFILE,ORECORD
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/14)26   B LOOP
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = LOOP
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/17)29   CLOSE (INFILE,,OUTFILE)
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = (INFILE,,OUTFILE)
00:33:19 PROG4b    AZ390 AZ390E error  29       (1/18)30   WTO 'PROG4 ENDED OK'
00:33:19 PROG4b    AZ390 AZ390I ERRSUM missing macro = 'PROG4
00:33:19 PROG4b    AZ390 AZ390E error  71       (1/19)31   SUBEXIT    
00:33:19 PROG4b    AZ390 AZ390I missing opcode - SUBEXIT    
00:33:19 PROG4b    AZ390 AZ390E ERRSUM Critical Error Summary Option
00:33:19 PROG4b    AZ390 AZ390E ERRSUM Fix and repeat until all nested errors resolved
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro ='PROGRAM
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =NOGEN
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro ='PROG4
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =(INFILE,INPUT)
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =(OUTFILE,OUTPUT)
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro ='FILES
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =INFILE,IRECORD
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =ORECORD,=CL133'
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =ORECORD(80),IRECORD
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =OUTFILE,ORECORD
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =LOOP
00:33:19 PROG4b    AZ390 AZ390E ERRSUM missing macro =(INFILE,,OUTFILE)
00:33:19 PROG4b    AZ390 AZ390E ERRSUM total missing   copy   files =0
00:33:19 PROG4b    AZ390 AZ390E ERRSUM total missing   macro  files =12
00:33:19 PROG4b    AZ390 AZ390E ERRSUM total undefined symbols      =0
00:33:19 PROG4b    AZ390 AZ390E ERRSUM total mz390 errors    = 0
00:33:19 PROG4b    AZ390 AZ390E ERRSUM total az390 errors    = 14
00:33:19 PROG4b    AZ390 AZ390I FID=  1 ERR=  14 c:\Program Files\Automated Software      Tools\z390\CS4321\PROG4b.MLC
00:33:19 PROG4b    MZ390 ENDED   RC=12 SEC= 0 MEM(MB)= 43 IO=601
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
eagerCommented:
The first message says: 'missing END statement'.  Your listing doesn't have an END statement.  Add one.

Labels start in the first column.  All other operands must start in column two or later, conventionally in column 10.  

Do you have a book about IBM Assembly Language?  

Look at http://en.wikipedia.org/wiki/IBM_Basic_assembly_language and http://en.wikibooks.org/wiki/360_Assembly.
0
 
JCW2Author Commented:
I added "END COPY" at the end.

result was

14:39:36 PROG4B    MZ390 MZ390E abort 84 file=1 line=21 internal system exception - java.lang.StringIndexOutOfBoundsException: String index out of range: 0
14:39:36 PROG4B    MZ390 MZ390I aborting due to recursive abort for invalid pass request during lookahead
14:39:36 PROG4B    MZ390 ENDED   RC=16 SEC= 0 MEM(MB)= 42 IO=25
0
 
eagerCommented:
Attach corrected source.
0
 
JCW2Author Commented:
TITLE 'PROGRAM 4 80/80 LISTING'
PRINT NOGEN
COPY SUBENTRY
WTO 'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
OPEN (INFILE,INPUT)
OPEN (OUTFILE,OUTPUT)
WTO 'Files opened successfully'
*
LOOP EQU *
GET INFILE,IRECORD
MVC ORECORD,=CL133' '
MVC ORECORD(80),IRECORD
PUT OUTFILE,ORECORD
B LOOP
*
EOF EQU *
CLOSE (INFILE,,OUTFILE)
WTO 'PROG4 ENDED OK'
SUBEXIT
ENDPGM DS D
END COPY
0
 
JCW2Author Commented:
and

TITLE 'PROGRAM 4 80/80 LISTING'
PRINT NOGEN
COPY SUBENTRY
WTO 'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
OPEN (INFILE,INPUT)
OPEN (OUTFILE,OUTPUT)
WTO 'Files opened successfully'
*
LOOP EQU *
GET INFILE,IRECORD
MVC ORECORD,=CL133' '
MVC ORECORD(80),IRECORD
PUT OUTFILE,ORECORD
B LOOP
*
EOF EQU *
CLOSE (INFILE,,OUTFILE)
WTO 'PROG4 ENDED OK'
SUBEXIT
END COPY

same output
0
 
JCW2Author Commented:
(Actually, the second output had "IO=25")
0
 
eagerCommented:
From previous messages:
   Be sure to leave (at least) the first column blank.

   Labels start in the first column.  All other operands must start in column two or later, conventionally in column 10.  
0
 
JCW2Author Commented:
16:17:03 PROG4b    MZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_26 10/08/11
16:17:03 PROG4b    AZ390 AZ390E error 198      (5/108)26                          LA     1,PROG4
16:17:03 PROG4b    AZ390 AZ390I symbol not defined PROG4
16:17:03 PROG4b    AZ390 AZ390E error 144     (5/108)105                          LA     1,COPY
16:17:03 PROG4b    AZ390 AZ390I no base register found
16:17:03 PROG4b    AZ390 AZ390E error  29       (1/9)119       LOOP EQU *
16:17:03 PROG4b    AZ390 AZ390I ERRSUM missing macro = LOOP
16:17:03 PROG4b    AZ390 AZ390E error 198      (7/37)121            LA    1,INFILE
16:17:03 PROG4b    AZ390 AZ390I symbol not defined INFILE
16:17:03 PROG4b    AZ390 AZ390E error 198      (7/44)122            LA    0,IRECORD
16:17:03 PROG4b    AZ390 AZ390I symbol not defined IRECORD
16:17:03 PROG4b    AZ390 AZ390E error 198      (1/11)125       MVC ORECORD,=CL133' '
16:17:03 PROG4b    AZ390 AZ390I symbol not defined ORECORD
16:17:03 PROG4b    AZ390 AZ390E error 198      (1/12)126       MVC ORECORD(80),IRECORD
16:17:03 PROG4b    AZ390 AZ390I symbol not defined ORECORD
16:17:03 PROG4b    AZ390 AZ390E error 198      (8/32)128            LA    1,OUTFILE
16:17:03 PROG4b    AZ390 AZ390I symbol not defined OUTFILE
16:17:03 PROG4b    AZ390 AZ390E error 198      (8/39)129            LA    0,ORECORD
16:17:03 PROG4b    AZ390 AZ390I symbol not defined ORECORD
16:17:03 PROG4b    AZ390 AZ390E error 198      (1/14)132       B LOOP
16:17:03 PROG4b    AZ390 AZ390I symbol not defined LOOP
16:17:03 PROG4b    AZ390 AZ390E error  29      (1/16)134       EOF EQU *
16:17:03 PROG4b    AZ390 AZ390I ERRSUM missing macro = EOF
16:17:03 PROG4b    AZ390 AZ390E error 198    (10/100)137                          LA     1,PROG4
16:17:03 PROG4b    AZ390 AZ390I symbol not defined PROG4
16:17:03 PROG4b    AZ390 AZ390E error 144    (10/100)141                          LA     1,COPY
16:17:03 PROG4b    AZ390 AZ390I no base register found
16:17:03 PROG4b    AZ390 AZ390E ERRSUM Critical Error Summary Option
16:17:03 PROG4b    AZ390 AZ390E ERRSUM Fix and repeat until all nested errors resolved
16:17:03 PROG4b    AZ390 AZ390E ERRSUM missing macro =LOOP
16:17:03 PROG4b    AZ390 AZ390E ERRSUM missing macro =EOF
16:17:03 PROG4b    AZ390 AZ390E ERRSUM total missing   copy   files =0
16:17:03 PROG4b    AZ390 AZ390E ERRSUM total missing   macro  files =2
16:17:03 PROG4b    AZ390 AZ390E ERRSUM total undefined symbols      =6
16:17:03 PROG4b    AZ390 AZ390E ERRSUM total mz390 errors    = 0
16:17:03 PROG4b    AZ390 AZ390E ERRSUM total az390 errors    = 13
16:17:03 PROG4b    AZ390 AZ390I FID=  1 ERR=   5 c:\Program Files\Automated Software Tools\z390\CS4321\PROG4b.MLC
16:17:03 PROG4b    AZ390 AZ390I FID=  5 ERR=   2 c:\PROGRA~1\AUTOMA~1\z390\mac\ZOPEN.MAC
16:17:03 PROG4b    AZ390 AZ390I FID=  7 ERR=   2 c:\PROGRA~1\AUTOMA~1\z390\mac\GET.MAC
16:17:03 PROG4b    AZ390 AZ390I FID=  8 ERR=   2 c:\PROGRA~1\AUTOMA~1\z390\mac\PUT.MAC
16:17:03 PROG4b    AZ390 AZ390I FID= 10 ERR=   2 c:\PROGRA~1\AUTOMA~1\z390\mac\ZCLOSE.MAC
16:17:03 PROG4b    MZ390 ENDED   RC=12 SEC= 0 MEM(MB)= 45 IO=1986


    TITLE 'PROGRAM 4 80/80 LISTING'
    PRINT NOGEN
COPY SUBENTRY
    WTO 'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
    OPEN (PROG4,INPUT)
    OPEN (COPY,OUTPUT)
    WTO 'Files opened successfully'
*
    LOOP EQU *
    GET INFILE,IRECORD
    MVC ORECORD,=CL133' '
    MVC ORECORD(80),IRECORD
    PUT OUTFILE,ORECORD
    B LOOP
*
    EOF EQU *
    CLOSE (PROG4,,COPY)
    WTO 'PROG4 ENDED OK'
    SUBEXIT
ENDPGM DS D
    END COPY


windows command line:
SET INFILE=PROG4.MLC
SET OUTFILE=COPY.TXT
..\ASMLG PROG4b.MLC > DUMP.TXT
0
 
eagerCommented:
The error messages tell you what is wrong -- read them.

    error 198      (5/108)26                          LA     1,PROG4
    symbol not defined PROG4
Where is PROG4 defined?  Your initial source file contained a DCB for PROG4. but your test program doesn't.

   error 144     (5/108)105                          LA     1,COPY
   no base register found
Where is the USING statement which specifies which base register to use?

   error  29       (1/9)119       LOOP EQU *
   missing macro = LOOP
Isn't LOOP a label?  Why doesn't it start in column 1?

>> Labels start in the first column.  All other operands must start in column two or later, conventionally in column 10.  

PLEASE:  Read the references I recommended about basic assembly language.  
0
 
JCW2Author Commented:
I have two copy programs from the pdf; can you tell me about which I use, or if they're nested? Or if I choose?
0
 
JCW2Author Commented:
I've entered "USING *,12" but I'm still getting the relevant error.
0
 
JCW2Author Commented:
This

        TITLE 'CS 4321 Program #4 by J. Colt Wright'
        PRINT NOGEN    
COPY          SUBENTRY
              SUBEXIT
INFILE  DCB   DDNAME=PROG4.MLC,    X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=72,         X
              EODAD=EOF,        X
              MACRF=GM          X
*
OUTFILE DCB   DDNAME=COPY.TXT,   X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=80,         X
              MACRF=PM          X
*
IRECORD DC    CL72' '
ORECORD DC    CL80' '
END COPY

has the error

17:55:30 PGM4      MZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_26 10/08/11
17:55:30 PGM4      MZ390 MZ390E abort 84 file=1 line=21 internal system exception - java.lang.StringIndexOutOfBoundsException: String index out of range: 0
17:55:30 PGM4      MZ390 MZ390I aborting due to recursive abort for invalid pass request during lookahead
17:55:30 PGM4      MZ390 ENDED   RC=16 SEC= 0 MEM(MB)= 42 IO=25
0
 
JCW2Author Commented:
       TITLE 'CS 4321 Program #4 by J. Colt Wright'
        PRINT NOGEN    
COPY          SUBENTRY
              SUBEXIT
INFILE  DCB   DDNAME=PROG4.MLC,    X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=72,         X
              EODAD=EOF,        X
              MACRF=GM          X
*
OUTFILE DCB   DDNAME=COPY.TXT,   X
              DSORG=PS,         X
              RECFM=FT,         X
              LRECL=80,         X
              MACRF=PM          X
*
IRECORD DC    CL72' '
ORECORD DC    CL80' '
              ENDPGM  DS D
              END COPY

18:11:22 PGM4      MZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_26 10/08/11
18:11:22 PGM4      AZ390 AZ390E error  29       (1/6)128                 DSORG=PS,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = DSORG=PS,
18:11:22 PGM4      AZ390 AZ390E error  29       (1/7)129                 RECFM=FT,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = RECFM=FT,
18:11:22 PGM4      AZ390 AZ390E error  29       (1/8)130                 LRECL=72,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = LRECL=72,
18:11:22 PGM4      AZ390 AZ390E error  29       (1/9)131                 EODAD=EOF,        X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = EODAD=EOF,
18:11:22 PGM4      AZ390 AZ390E error  29      (1/10)132                 MACRF=GM          X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = MACRF=GM
18:11:22 PGM4      AZ390 AZ390E error  29      (1/13)169                 DSORG=PS,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = DSORG=PS,
18:11:22 PGM4      AZ390 AZ390E error  29      (1/14)170                 RECFM=FT,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = RECFM=FT,
18:11:22 PGM4      AZ390 AZ390E error  29      (1/15)171                 LRECL=80,         X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = LRECL=80,
18:11:22 PGM4      AZ390 AZ390E error  29      (1/16)172                 MACRF=PM          X
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = MACRF=PM
18:11:22 PGM4      AZ390 AZ390E error  29      (1/20)176                 ENDPGM  DS D
18:11:22 PGM4      AZ390 AZ390I ERRSUM missing macro = ENDPGM
18:11:22 PGM4      AZ390 AZ390E ERRSUM Critical Error Summary Option
18:11:22 PGM4      AZ390 AZ390E ERRSUM Fix and repeat until all nested errors resolved
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =DSORG=PS,
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =RECFM=FT,
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =LRECL=72,
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =EODAD=EOF,
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =MACRF=GM
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =LRECL=80,
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =MACRF=PM
18:11:22 PGM4      AZ390 AZ390E ERRSUM missing macro =ENDPGM
18:11:22 PGM4      AZ390 AZ390E ERRSUM total missing   copy   files =0
18:11:22 PGM4      AZ390 AZ390E ERRSUM total missing   macro  files =8
18:11:22 PGM4      AZ390 AZ390E ERRSUM total undefined symbols      =0
18:11:22 PGM4      AZ390 AZ390E ERRSUM total mz390 errors    = 0
18:11:22 PGM4      AZ390 AZ390E ERRSUM total az390 errors    = 10
18:11:23 PGM4      AZ390 AZ390I FID=  1 ERR=  10 c:\Program Files\Automated Software Tools\z390\CS4321\PGM4.MLC
18:11:23 PGM4      MZ390 ENDED   RC=12 SEC= 0 MEM(MB)= 44 IO=1322

0
 
eagerCommented:
If you are having a problem with an assignment, ask your instructor.  

There is one program in your handout, not two.  Both pieces need to be in the same file.

What do you suspect those X's on the right side of the lines are?  You know, the ones which get an error each time? What did your instructor say about them? Did he describe how one continues a command from one line to the next?
0
 
JCW2Author Commented:
   TITLE 'PROGRAM 4 80/80 LISTING'
   
    PRINT NOGEN
COPY SUBENTRY
   
    WTO 'PROG4 COPY PROG4 (ASCII) TO COPY (ASCII)'
    USING *,12
    OPEN (INFILE,INPUT)
    OPEN (OUTFILE,OUTPUT)
    WTO 'Files opened successfully'
*
LOOP EQU *
    GET INFILE,IRECORD
    MVC ORECORD,=CL133' '
    MVC ORECORD(80),IRECORD
    PUT OUTFILE,ORECORD
    B LOOP
*
    EOF EQU *
    CLOSE (INFILE,,OUTFILE)
    WTO 'PROG4 ENDED OK'
    SUBEXIT
ENDPGM DS D
    END COPY
0
 
JCW2Author Commented:
Do you mean they're nested?
0
 
JCW2Author Commented:
That's the info I needed; thanks for your help.
0
 
JCW2Author Commented:
That's the info I needed to find out whether they're nested; thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.