Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Question on the TSO CALL statement syntax

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Thu Sep 11, 2014 3:02 am    Post subject: Question on the TSO CALL statement syntax
Reply with quote

Greetings Good People!

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
Guide.

So, what does the "*" imply here?

CALL *(ASMA90) ‘ADATA,LIST(133),OBJECT,TERM’

TIA.

friarDuncan
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Thu Sep 11, 2014 6:02 am    Post subject:
Reply with quote

The * effectively replaces the name of a program library.

The macros used to define a command line for IKJPARS provide for this, though it took 30 years or more to realize how simply it could be done.

Thge original macros for the CALL command were something like this.
Code:
pclname  IKJPARM DSECT=pdlname
pgm      IKJPOSIT DSNAME,USID,PROMPT='PROGRAM AS LIBRARY(MEMBER)'
parm     IKJPOSIT QSTRING
         IKJENDP
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.
Code:
pdlname  DSECT
         DS    2A
pgm      DS    A,H,2AL1,A,H,2AL1,A,H,2AL1
parm     DS    A,H,2AL1

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.
Back to top
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Sat Sep 13, 2014 12:59 am    Post subject:
Reply with quote

Gee Steve, THANKS for that info...

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.

Merci.

friarDuncan
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Sat Sep 13, 2014 6:12 am    Post subject:
Reply with quote

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 *.
Code:
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
         ST    0,PPLPCL
         LA    0,PDLADDR
         ST    0,PPLANS
         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
         STH   15,RC
         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,      ->
               SZERO=NO,SHSPV=78,ECB=ECB,EPLOC=PROGRAM
         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
         FREEMAIN R,LV=(0),A=(11)
         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
         DC    0D'0'
         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
         IKJENDP
         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
         END   INVMVT
Back to top
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Tue Sep 16, 2014 5:21 am    Post subject:
Reply with quote

Yow!

Thanks for that code.

With attribution I will add it to my collection of code. Is that okay with you?

You are a good teacher.

I (and many others here, I am sure) would like to say a "Thanks".

Cheers to you and all readers here,

friarDuncan
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Tue Sep 16, 2014 5:42 am    Post subject:
Reply with quote

It turned out there are two bugs in the code. You can find them yourself.
Back to top
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Wed Sep 24, 2014 1:46 am    Post subject:
Reply with quote

Awesome....

For the bugs, I mean... HEHEHEHEHE....

Haven't had much time to play and learn of late... But the first chance
I get I'll try the code....

Hahahahaha... Man, this takes me back to classroom daze...

friarDuncan
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 462
Location: The Universe

PostPosted: Mon Oct 20, 2014 8:09 am    Post subject:
Reply with quote

Duncan Sharppe wrote:
... "How to Write a TMP or CP" manual that I snarfed from BITSAVERS.org ...
The current manual is "TSO/E Programming Services." The manual is considerably different, of course, but the IKJPARS stuff hasn't changed very much.

Which reminds me. The IKJPOSIT macro for the MVT TSO system did not have the USID parameter; that was added with MVS.
Back to top
View user's profile Send private message
Duncan Sharppe

New User


Joined: 13 Dec 2013
Posts: 20
Location: USA

PostPosted: Thu Oct 23, 2014 4:34 am    Post subject:
Reply with quote

Man, are you a RESOURCE OR WHAT...!!!

One day I wanna grow up to be like steve-myers....

Hahahahah....hehehehehhahah...

Merci,

Duncan, the friar
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Oct 23, 2014 4:48 am    Post subject:
Reply with quote

Quote:
Man, are you a RESOURCE OR WHAT...!!!

One day I wanna grow up to be like steve-myers....


icon_cool.gif So does everyone but it is next to impossible..... icon_sad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Cobol EZASOKET call to SETSOCKOPT fails Andi1982 COBOL Programming 6 Thu Oct 06, 2016 7:12 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us