Okay, so I've seen this type of statement several times and cannot find any
documentation on the leading star (as I call it) in the CALL statement
below. This particular statement example comes from the HLA Programmer's
These macros define two things, which does make things confusing. They define a PCL (Parameter Control List) and a PDL (Parameter Descriptor List). The PCL is a CSECT that describes the command line; the PDL is a DSECT for our convenience that IKJPARS builds and returns to our program. The DSECT will be something like this.
The first address constant points to the data set name text in the command line; the halfword contains the length of the text, and the first byte in the 2AL1 contains flags that indicate the A and H contain data, and for a data set name, that the command line text was in quotation marks.
The second address constant, length and flags contain the data for a member name.
Never mind about the third set.
The only change in the parse macros to support *(program) was to change DSNAME to DSTHING. The original idea for DSTHING was to support a syntax that includes wild card data like *. DSTHING was in parse from the beginning, though it was rarely used.
Obviously the code for CALL had to be changed to note the * and not use it to allocate a data set and test if the member is in the data set, but that was minor.
As I was doing my research for this I think I came across the IKJPARS macro you mentioned in the "How to Write a TMP or CP" manual that I snarfed from BITSAVERS.org . The only reason I recall this is because it was only a few days ago that I was over at BITSAVERS.... Hahahaha...
Now I'll have to read that in detail to get the base history from whence comes the "CALL *" statement.
Joined: 30 Nov 2013 Posts: 859 Location: The Universe
Many programmers wrote a command processor to do something like CALL *(member). I did it in 1972 or 1973, though the syntax was something like cmdname program 'parameters'. I think you can find at least one example in CBT. There were often embellishments. For example, I added the ability to display the return code and some other improvements, though the CALL command added the ASIS keyword to allow the parameter text to contain lower case characters about the time it added CALL *, and before I did the same in my command.
I have no idea why IBM did CALL *, though at some point they must have noted the increased use of CALL 'SYS1.LINKLIB(program)', which would produce a similar effect as CALL *.
INVMVT CSECT Define program CSECT
USING *,12 Establish program addressability
USING PPL,11 Establish PPL addressability
USING PDL,10 Establish PDL addressability
SAVE (14,12),,* Save registers
LR 12,15 Prepare program base register
LR 2,1 Copy CPPL address to reg 2
LM 6,9,0(1) Load the CPPL into registers 6 to 9
LA 5,WASIZE Load length of the PPL
GETMAIN R,LV=(5) Allocate storage for the PPL
LR 11,1 Copy the PPL address to reg 11
ST RCBUF,PPLCBUF Initialize
ST RECT,PPLECT the
ST RUPT,PPLUPT TSO
LA 0,ECB Parse
ST 0,PPLECB Parameter
L 0,=A(PCL) List
LA 15,SAVEAREA Load address of the new save area
ST 13,4(,15) Add the new save area to the
ST 15,8(,13) save area chain
LR 13,15 Establish new save area pointer
SR 15,15 Initialize the return code
LINK SF=(E,CALLPARS),MF=(E,(11)) Invoke IKJPARS
LTR 15,15 IKJPARS completed OK?
BNZ EXIT Br if not
STH 15,PARMLEN Initialize the parameter length
MVC PROGRAM,=CL8' ' Initialize program name
L 10,PDLADDR Load address of the PDL
L 1,PGM Load address of the program name
LH 15,PGM+4 Load length of the program name
BCTR 15,0 Reduce length by 1
EX 15,MOVEPGM Copy program name to the work area
TM PARM+6,X'80' Test if parameter text specified
BZ NOPARM Br if not
LH 15,PARM+4 Load length of the parameter text
STH 15,PARMLEN Save the length
L 1,PARM Load address of the parameter text
LA 14,PARMTEXT Load address of parm text
LA 0,256 Set reg 0
COPYPARM CR 15,0 Remaining length > 256?
BNL COPYLAST Br if remaining length <= 256
MVC 0(256,14),0(1) Copy 256 bytes
AR 14,0 Update pointer
AR 1,0 registers
SR 15,0 Update remaining length
B COPYPARM Copy more data
COPYLAST BCTR 15,0 Reduce remaining length by 1
EX 15,MVCPARM Copy remaining parm text
IKJRLSA PDLADDR Release the PDL
NOPARM XC ATTPL(ATTPLSZ),ATTPL Clear the ATTACH macro parm list
MVI ECB,0 Reset the ECB
ATTACH SF=(E,ATTPL),MF=(E,PARMLIST),VL=1,PARAM=PARMLEN, ->
ST 1,TCBADDR Save the TCB address
WAIT 1,ECB=ECB Wait for the subtask to complete
LH 15,ECB+2 Load the return code fom the ECB
STH 15,RC Save the return code
DETACH TCBADDR Delete the completed TCB
LH 15,RC Load the return code
EXIT LR 10,15 Copy the return code to reg 10
L 13,4(,13) Load addr of the higher save area
LA 0,WASIZE Free the PPL
RETURN (14,12),T,RC=(15) Restore registers & return
MVCPARM MVC 0(*-*,14),0(1) ** Execute only **
MOVEPGM MVC PROGRAM(*-*),0(1) ** Execute only **
CALLPARS LINK SF=L,EP=IKJPARS LINK macro parameter list
LTORG , Define the literal pool
PCL IKJPARM DSECT=PDL Define IKJPARS PCL and PDL
PGM IKJIDENT 'PROGRAM NAME',FIRST=ALPHA,OTHER=ALPHANUM, ->
MAXLNTH=8,PROMPT='PROGRAM NAME TO RUN'
PARM IKJPOSIT QSTRING
IKJCPPL , Define TSO CPPL
RCBUF EQU 6+(CPPLCBUF-CPPL)/4 Define registers after loading the
RECT EQU 6+(CPPLECT-CPPL)/4 CPPL into registers 6 through 9
RUPT EQU 6+(CPPLUPT-CPPL)/4
IKJPPL , Define TSO PPL
SAVEAREA DS 18F Save area
PROGRAM DS CL8 Program name
ECB DS F ECB for IKJPARS and program
PDLADDR DS A PDL address returned by IKJPARS
ATTPL ATTACH SF=L ATTACH macro parameter list
ATTPLSZ EQU *-ATTPL Length of the parameter list
PARMLIST CALL ,(*-*),VL,MF=L Program parameter list
TCBADDR DS A TCB address
RC DS H Return code
PARMLEN DS H Parameter text length
PARMTEXT DS 0C Parameter text
WASIZE EQU 4096-8 Work area size