0

I have the following JCL to compile an assembly language program :-

//JRETEST JOB (A925,22360679777),'AESANJA',NOTIFY=&SYSUID,
//        MSGLEVEL=(1,1)
//PROCLID JCLLIB ORDER=IBMUSER,LEARN.ASMJCL
//     EXEC ASMACL
//SYSOUT DD SYSOUT=*
//C.SYSIN DD *
TEST   START 0
       PRINT NOGEN
*      SAMPLE PROGRAM
       BASR 15,0
       USING *,15
       PRINTOUT MYNAME,*
MYNAME DC C'ADRIAN EKA SANJAYA'
       END TEST
/*

When I run this I get an "undefined operation field" error indicating that PRINTOUT is the undefined operation.

Screen showing undefined operation field.

I am quite confused as I am following a guide, the code being similar :-

//JRETEST JOB (A925,2236067977),′ J.EHRMAN′
// EXEC ASMACLG
//C.SYSIN DD *
Test Start 0 First line of program
       Print NoGen
* Sample Program
       BASR 15,0 Establish a base register
       Using *,15 Inform the Assembler
       PRINTOUT MyName,* Print name and stop
MyName DC C′ John R. Ehrman′ Define constant with name
       END Test Last statement
/* 
MikeT
  • 51,415
  • 16
  • 49
  • 68
  • Welcome to stackoverflow.com. Please take some time to read the [help pages](https://stackoverflow.com/help), especially the sections named ["What topics can I ask about here?"](https://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](https://stackoverflow.com/help/dont-ask). Also please take the [tour](https://stackoverflow.com/tour) and read about [how to ask good questions](https://stackoverflow.com/help/how-to-ask). Lastly please learn how to create a [Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve). – cschneid Oct 29 '17 at 14:12

3 Answers3

2

PRINTOUT is not an operation code as defined in the z/OS Principles of Operation. PRINTOUT is also apparently not a macro defined in a library in the SYSLIB concatenation of the step executing the ASMA90 program in your ASMACL cataloged procedure.

It is possible your instructor did this deliberately to begin to teach you how to diagnose problems with your code using the Assembly listing. Documentation for the IBM High Level Assembler (HLASM) is here. The documentation includes information about how to diagnose problems with your code using the Assembly listing.

cschneid
  • 10,237
  • 1
  • 28
  • 39
  • sorry sir, but the book Assembler Language Programming for IBM z System™ Servers [link](https://www.google.co.id/search?safe=off&dcr=0&ei=8VP3Wam0GJaavQT1wp6oBg&q=assembler+language+programming+for+ibm+z+system+servers&oq=assembler+language+programming&gs_l=psy-ab.1.4.0i13k1j0i203k1j0i13k1l2j0i203k1j0i13k1l2j0i13i30k1l3.439369.443935.0.445514.27.19.2.0.0.0.272.2224.2j6j5.13.0....0...1.1.64.psy-ab..12.15.2228...0j35i39k1j0i10k1.0.WipYdhwQsrg) code like as the printout is the operation in assembly – Adrian Eka Oct 30 '17 at 16:39
  • **PRINTOUT** is not a command, it is a **MACRO instruction** saying to incorporate/expand the said macro into the code. A **MACRO** has to be a member within the libraries allocated to the **SYSLIB** `ddname` for the assembler program (ASMA90). If it is not then the Assembler will have no means of interpreting what it then thinks is an operation code. That is the issue and cause. As such you need to ascertain if the macro library that contains the **PRINTOUT** macro is allocated to the `ddname` **SYSLIB** in the **ASMACL** procedure. See 6.1.1 – MikeT Oct 31 '17 at 11:15
  • 1
    @AdrianEka just because the macro is present in sample code in John Ehrman's excellent book doesn't mean it has been implemented in your system. The book to which you refer contains the macro source which must be present in a library in the SYSLIB concatenation of the step executing ASMA90. – cschneid Oct 31 '17 at 16:51
2

The underlying cause is that macros used in Ehrman's book are not included in any standard macro libraries. You can either copy them from the book or get them from https://idcp.marist.edu/documents/33945/44724/Macros+%281%29.zip/b268c9c7-c9c5-32a5-d078-072131ef4625?t=1551806362564 and copy them to some maclib for later use.

povk
  • 49
  • 3
0

in my opinion you used a lowercase letter in your JCL. So correcting //c.SYSIN to //C.SYSIN should do the work. CU Andreas

  • 2
    Isn't //c.SYSIN a comment? – Vega Nov 03 '17 at 08:53
  • @Vega, No it's not a comment it's an override of the **SYSIN DDNAME** in **STEP C**, that passes the following code, up to the **`/*`** delimiter, into the **SYSIN DDNAME** as what is termed as instream data. re the UpperCase/LowerCase **C**, the screenshot shows uppercase C, **my** error as I copied the code from the screenshot, I will amend the question accordingly. – MikeT Nov 03 '17 at 13:04