Posted: Mon May 31, 2004 1:02 am Post subject: Regarding calls
Hi,
How can we say that wether the main program is calling a subroutine .
eithere statically r dynamicllay. without seeing loadmodule and compiler options.
i am using cobol program , in that i neeed to find out whcih call it is using to call a subrotuine. without seeing loadmodule and compilere options.
If the source program uses a variable for the program name in the call, this call will always be dynamic and you do not need to see the compilation options or load module to know this.
If the source program uses a constant for the program name, it is impossible to say whether it will be a dynamic or static CALL without referring either to the compilation options or the load module (you can extract the compilation options from the load module). The option DYNAM/NODYNAM will control whether such a call is dynamic or static.
Note to Ravi: the original post was about dynamic/static calls and which was being used. You don't address this issue at all in your answer so I'm not surprised the poster wasn't satisfied.
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Tue Jun 01, 2004 8:58 am Post subject:
Mike , You mentioned something interesting ... and if I'd like to extract the Compile options from the Load module , how is this achieved ?
I was looking at the load but its as usual all greek and latin ,is it through a utility ?
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Jun 01, 2004 9:28 am Post subject:
Vini,
Mike must be refering to AMBLIST utility which is used to verify load modules.
Code:
AMBLIST, The Service Aid Program
AMBLIST can be used to verify an object module, map CSECTs within a load module, verify the contents of the nucleus, trace modifications to the executable code within a CSECT, and map link pack areas.
Sample JCL for AMBLIST appears below; following the JCL is a discussion of each DD statement required by AMBLIST and what each is used for. An explanation of AMBLIST control statements follows the JCL discussion, and AMBLIST usage examples appear at the end of this
reference item.
SYSPRINT DD :
The SYSPRINT DD statement is required and must have RECFM=FBA.
The BLKSIZE value can be any value up to 32670 that is a
multiple of 121. AMBLIST messages are written to this file.
myddname DD :
The 'myddname' DD statement is required and points to the data
set being operated upon by the control statements. The DSNAME
and DISP parameters are required. Data set concatenation is
not supported. 'myddname' can be any valid DD name that you
supply, except SYSPRINT, SYSIN, or another special DD name.
SYSIN DD :
The SYSIN DD statement defines the data set containing AMBLIST
control statements.
Valid control statements for AMBLIST are LISTLOAD, LISTOBJ, LISTIDR, and
LISTLPA.
Control statement operands must appear between columns 2 through 71.
There must be a least one blank between the operation name and the
first parameter. Continuation is supported by ending the card with a
comma or a nonblank character in column 72 and continuing on the next
card. The continuation card must begin between columns 2 and 16.
Splitting parameters is not supported. The MEMBER parameter can be
split after a comma.
The syntax and usage of each control statement is discussed below:
LISTLOAD:
The LISTLOAD statement produces a summary report which includes
the member name and aliases, the entry point, the linkage
editor attributes, and the system status information (SSI) for
the load module. The formatted output portion of the report
includes the load module and/or the module map and cross
reference.
OUTPUT={MODLIST | XREF | BOTH}
Designate the type of printed output desired. 'MODLIST'
produces a list of the control and text records with the
ESD and RLD records. 'XREF' will produce a module map and
a cross reference. 'BOTH' produces 'MODLIST' and 'XREF'
listings. If omitted the default is 'BOTH'.
TITLE=('title',position)
A one to forty character title to be printed below the
heading line on each page of the report. 'position' is a
number between 1 and 80 indicating where the title should
start on the print title line. If not specified or
greater than 80, 1 is assumed. Commas are not permitted
within the title
DDN=ddname
'DDN' is the name of the DD statement that defined the
data set containing the module to be listed, listed as
'myddname' in the JCL skeleton example above. SYSLIB is
assumed if the parameter is omitted.
MEMBER={member | (member1,membern...)}
'MEMBER' is used to name the module(s) by member name or
alias name. To list more than one module specify each
name separated with a comma and enclosed with parentheses.
If no members are specified then the entire data set is
be listed.
RELOC=hhhhhh
'RELOC' is a hexadecimal number up to eight characters in
length that specifies the base address to be added to
each relative map and cross-reference address for each
item on the report. There is no default assumed.
LISTOBJ:
The LISTOBJ statement produces a formatted listing of the
external symbol dictionary (ESD), the relocation directory
(RLD), the text records containing program instructions and
data, and the END record of an object module.
TITLE=('title',position)
A one to forty character title to be printer below the
heading line on each page of the report. 'position' is a
number between 1 and 80 that you want the title indented.
If not specified or greater than 80, 1 is assumed. Commas
are not permitted.
DDN=ddname
'DDN' is the name of the DD statement that defined the
data set containing the module to be listed, listed as
'myddname' in the JCL skeleton example above. SYSLIB is
assumed if the parameter is omitted.
MEMBER={member|(member1,membern...)}
'MEMBER' is used to name the module(s) by member name or
alias name. To list more than one module specify each name
separated with a comma and enclosed with parentheses. If no
members are specified then the entire data set is be listed
LISTIDR:
The LISTIDR statement produces a formatted report of the IDR
information. Included in the report are; the date the CSECT
was translated, version modification level of the translator,
version modification level of the linkage editor, the link edit
date, and SPZAP modifications by date to the module.
OUTPUT={IDENT | ALL}
'IDENT' requests that only IDR records with SPZAP or user
supplied data be listed. 'ALL' requests that all IDR
records be printed. If omitted, the default is ALL.
OUTPUT cannot be used with the MODLIB parameter.
TITLE=('title',position)
A one to forty character title to be printer below the
heading line on each page of the report. 'position' is a
number between 1 and 80 that you want the title indented.
If not specified or greater than 80 1 is assumed. Commas
are not permitted.
DDN=ddname
'DDN' is the name of the DD statement that defined the
data set containing the module to be listed, listed as
'myddname' in the JCL skeleton example above. SYSLIB is
assumed if the parameter is omitted.
MEMBER={member|(member1,membern...)}
'MEMBER' is used to name the module(s) by member name or
alias name. To list more than one module specify each
name separated with a comma and enclosed with
parentheses. If no members are specified then the entire
data set is be listed.
MODLIB
Specify 'MODLIB' to produce a report of IDR records with
SPZAP or user-supplied data only. The report is produced
without page breaks. The module summary report will not be
produced and the OUTPUT and MEMBER parameters are invalid.
The TITLE parameter is ignored.
LISTLPA:
The LISTLPA statement produces a report for the current
operating system of the modules in the fixed, modified, and
pageable link pack area including the extended areas. If the
parameters are omitted, the default is a list of all 3 link
pack areas.
LISTLPA {FLPA}{,MLPA}{,PLPA}
FLPA
'FLPA' requests a report of the modules in the fixed link
pack area.
MLPA
'MLPA' requests a report of the modules in the modified
link pack area.
PLPA
'PLPA' requests a report of the modules in the pageable
link pack area.
AMBLIST Usage Examples:
JCL and control statements to list several object modules:
JCL and control statements to list several load modules:
//AS10 EXEC PGM=AMBLIST,REGION=100K
//SYSPRINT DD SYSOUT=*
//SYSLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//LINKLIB DD DSN=SYS2.LINKLIB,DISP=SHR
//PPLIB DD DSN=SYS2.PGMPRDS,DISP=SHR
//SYSIN DD *
LISTLOAD OUTPUT=MODLIST,DDN=LINKLIB,
MEMBER=USEREXIT,
TITLE=('AMBLIST OF LOAD MODULE USEREXIT',45)
LISTLOAD OUTPUT=XREF,DDN=PPLIB,
MEMBER=(PROGRAM1,PROGRAM2,PROGRAM3,PROGRAMN),
TITLE=('XREF OF PROGRAM1-PROGRAM3,PROGRAMN',43)
LISTLOAD TITLE=('XREF AND LOAD MODULE LIST SYS1.SORTLIB',41)
/*
JCL and control statements to list the IDR information for several
load modules:
//AS10 EXEC PGM=AMBLIST,REGION=100K
//SYSPRINT DD SYSOUT=*
//SYSLIB DD DSN=SYS1.LINKLIB,DISP=SHR
//MYLOAD DD DSN=USER.LOADLIB,DISP=SHR
//SYSIN DD *
LISTIDR TITLE=('IDR INFO FOR ALL OF LINKLIB',42)
LISTIDR OUTPUT=IDENT,
DDN=MYLOAD,
MEMBER=MYPROG,
TITLE=('IDR INFO FOR MYPROG IN MYLOAD',46)
LISTIDR DDN=MYLOAD,MODLIB
/*
JCL and control statements to list the nucleus and all link pack
areas:
Here's a REXX that should work for COBOL 2 and above
Code:
/*REXX*/
arg loadlib loadmod
userid=sysvar(sysuid)
prefix=sysvar(syspref)
if loadlib='' & loadmod='' then
do
say " "
say "Command syntax: TSO <%>COBINFO <'loadlib'> <loadmod>"
say " "
say "(Items in <> are optional; include quotes around",
"loadlib when appropriate)"
say " "
say " When compiling a module using COBOL the compile time",
"options as well as other"
say "useful information are saved in the resulting object code",
"in the form of bit"
say "switches. This Rexx exec will parse a specified load module,",
"locate any COBOL"
say "for MVS or COBOL2 csects within it and translate the bit",
"switches back into a"
say "readable format."
say " "
end
/* */
/* Get the load library name and verify that it is a valid loadlib. */
/* */
get_loadlib:
if loadlib='' then
do
say ' '
say 'Enter the name of your load library',
'(or just press ENTER to end):'
pull loadlib
end
if loadlib='' then exit(0)
if substr(loadlib,1,1)\="'" & prefix\='' then loadlib=prefix'.'loadlib
loadlib=strip(loadlib,B,"'")
if sysdsn("'"loadlib"'")\='OK' then
do
say 'Data set 'loadlib' not found!'
loadlib=''
signal get_loadlib
end
else
do
x=listdsi("'"loadlib"'")
if x=0 then
do
if sysdsorg\='PO'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum