ca.portal.admin

Re:Re: COBOL question

Discussion created by ca.portal.admin on Jun 8, 2009
Kay, I think you can still compile with the assembler code
option. That should give you the required addresses.
Paul Wood
IBM Global Services
Mainframe Databases, Modeling, Repository Tech. Lead

Home Office: (714) 876-0497
pawood@us.ibm.com



""Rozeboom, Kay [DAS]"" <KAY.ROZEBOOM@IOWA.GOV> Sent by: IDMS
Public Discussion Forum <IDMS-L@LISTSERV.IUASSN.COM>
06/08/2009 11:43 AM
Please respond to
IDMS Public Discussion Forum <IDMS-L@LISTSERV.IUASSN.COM>


To
IDMS-L@LISTSERV.IUASSN.COM
cc

Subject
COBOL question






Can anyone point me to a tutorial or documentation on how to
find the location of a working-storage field in the load module
of a COBOL program?
(As opposed to finding it in a dump.) I do have a compile
listing available.

Kay Rozeboom
State of Iowa
Information Technology Enterprise
Department of Administrative Services
Telephone: 515.281.6139 Fax: 515.281.6137
Email: Kay.Rozeboom@Iowa.Gov
This e-mail may contain confidential or privileged information. If
you think you have received this e-mail in error, please advise the
sender by reply e-mail and then delete this e-mail immediately.
Thank you. Aetna
"
IDMS 3rd-party providers forum
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP
IDMSVENDOR-L@LISTSERV.IUASSN.COM
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: COBOL question
"Even batch Cobol programs are quasi-reentrant, meaning the cobol loader=0D=
=0A(which is actually the beginning of every cobol program, inserted by the=
=0D=0Acompiler) relocates working storage into a piece of getmained storage=
=2E=0D=0AThat's why she's seeing two versions of working storage=2E=0D=0A=
=0D=0A=0D=0ALutz Petzold=0D=0ATDM UDB/IDMS Support=0D=0A401-782-2265=0D=0AP=
age 860 366 0865 or Telalert=0D=0A =0D=0A =0D=0A=0D=0A-----Original Message=
-----=0D=0AFrom: IDMS Public Discussion Forum =0D=0A[mailTo:IDMS-L@LISTSERV=
=2EIUASSN=2ECOM] On Behalf Of Miley, Dan L=0D=0ASent: Tuesday, June 09, 200=
9 2:17 PM=0D=0ATo: IDMS-L@LISTSERV=2EIUASSN=2ECOM=0D=0ASubject: Re: COBOL q=
uestion=0D=0A=0D=0AWell, not all COBOL programs are reentrant=2E Many batc=
h =0D=0Aprograms are not=2E Not sure if this is batch or online program=2E=
=0D=0A But actually, since all Kay is looking for is a literal it is =0D=
=0Amuch easier to do since the literal pool is in load module =0D=0Aregardl=
ess of whether not the program is reentrant=2E At least =0D=0Ain COBOL II =
(where we stopped at LMC - no more development in =0D=0ACOBOL), the literal=
pool can be found in the listing like this:=0D=0A=0D=0ALITERAL POOL MAP FO=
R LITERALS IN THE CGT:=0D=0A=0D=0A0002AC (LIT+0) 00124F68 00014BB3 00=
02585C=0D=0A0002CC (LIT+32) 00124F74 000258F6 000375D5=0D=0A=0D=0AIf t=
he literal you want to change is some unique value then it =0D=0Ashould be =
easy to spot in the map and you can simply use =0D=0AAMASPZAP to modify the=
load module=2E If however, there is =0D=0Aspecific use in the program for=
a certain literal, then you =0D=0Awould need to compile the program with t=
he LIST option, then =0D=0Alook at the pseudo assembler code to figure whic=
h literal you =0D=0Awant to zap=2E For example:=0D=0A=0D=0AWe want to chan=
ge 'CPSBP322' to 'KAYBP322' for some reason in =0D=0Athis bit of code:=0D=
=0A=0D=0A003279 115300 MOVE 'CPSBP322' TO PROGRAM-NAME=2E=0D=0A=
=0D=0AWe then find line 3279 in the pseudo assembler:=0D=0A=0D=0A=0D=0A0032=
79 MOVE=0D=0A 004FD0 D207 85B8 7C0A MVC 1464(8,8),3082(7) =
=0D=0A (BLW=3D713)+1464 PGMLIT AT +6766=0D=0A=0D=0AWe would then know t=
hat the offset that compiler is using for =0D=0Athis literal is at PGMLIT +=
6766=0D=0A=0D=0AThen we find that literal in the literal pool:=0D=0A001D0C=
(LIT+6752) E2C2D7F4 F3F3C3D7 E2C2D7F4 F3F2C3D7 =0D=0AE2C2D7F3 F2F2E2D6 =
D9E3E2C740E2E8 |SBP433CPSBP432CPSBP322SORTMSG SY=0D=0A=0D=0AThen the VER a=
nd REP cards would be:=0D=0AVER 001D1A C3D7E2=0D=0AREP 001D1A D2C1E8=0D=0A=
=0D=0ADan Miley=0D=0ALockheed Martin=0D=0A=0D=0A=0D=0A=0D=0A-----Original M=
essage-----=0D=0AFrom: IDMS Public Discussion Forum =0D=0A[mailTo:IDMS-L@LI=
STSERV=2EIUASSN=2ECOM] On Behalf Of Petzold, Lutz=0D=0ASent: Tuesday, June =
09, 2009 8:24 AM=0D=0ATo: IDMS-L@LISTSERV=2EIUASSN=2ECOM=0D=0ASubject: Re: =
COBOL question=0D=0A=0D=0AOne trick programmers do, is to include a filler =
with 'working =0D=0Astorage starts here' at the beginning of working storag=
e=2E But, =0D=0Aa 'map' compile option will give you a map of relative =0D=
=0Adisplacements for all elements in working storage section=2E Now =0D=0A=
keep in mind that in memory, there are TWO working storage =0D=0Asections=
=2E One in the load module as you say, but that the real =0D=0Aone has bee=
n relocated by the cobol loader and it's somewhere =0D=0Ain memory=2E Othe=
rwise, the program would not be reentrant, and =0D=0Ain an online system yo=
u'd need one copy of the program in =0D=0Amemory for each invocation=2E=0D=
=0A=0D=0ALutz Petzold=0D=0ATDM UDB/IDMS Support=0D=0A401-782-2265=0D=0APage=
860 366 0865 or Telalert=0D=0A=0D=0A=0D=0A=0D=0A-----Original Message-----=
=0D=0AFrom: IDMS Public Discussion Forum=0D=0A[mailTo:IDMS-L@LISTSERV=2EIUA=
SSN=2ECOM] On Behalf Of Rozeboom, Kay [DAS]=0D=0ASent: Tuesday, June 09, 20=
09 8:16 AM=0D=0ATo: IDMS-L@LISTSERV=2EIUASSN=2ECOM=0D=0ASubject: Re: COBOL =
question=0D=0A=0D=0AActually, I want to be able to zap a literal in working=
=0D=0Astorage=2E But the same literal appears more than once in the =0D=
=0Aload module, so I need to make sure that I get the right one=2E=0D=0AI a=
m thinking that the only solution may be to change the code =0D=0Ato make t=
he original literals unique, then ""eyeball"" the load =0D=0Amodule to find t=
he location of the literal=2E=0D=0A=0D=0A=0D=0A-----Original Message-----=
=0D=0AFrom: IDMS Public Discussion Forum=0D=0A[mailTo:IDMS-L@LISTSERV=2EIUA=
SSN=2ECOM] On Behalf Of Miley, Dan L=0D=0ASent: Monday, June 08, 2009 4:19 =
PM=0D=0ATo: IDMS-L@LISTSERV=2EIUASSN=2ECOM=0D=0ASubject: Re: COBOL question=
=0D=0A=0D=0AThe LIST option is not required to find locations in the =0D=0A=
program=2E The MAP option should be sufficient=2E But working=0D=0Astorag=
e fields are not really ""in"" the load module=2E They=0D=0Apointed to by a=
base locator and an offset=2E I assume she=0D=0Awants it for some sort o=
f debugging session, but I would need =0D=0Amore information to help answer=
the question=2E Key questions are:=0D=0A=0D=0A1=2E What compiler level=
=0D=0A2=2E Online or batch=0D=0A3=2E Reentrant or non-reentrant=0D=0A=0D=
=0ADan Miley=0D=0ALockheed Martin=0D=0A=0D=0A=0D=0A-----Original Message---=
--=0D=0AFrom: IDMS Public Discussion Forum=0D=0A[mailTo:IDMS-L@LISTSERV=2EI=
UASSN=2ECOM] On Behalf Of Paul A Wood=0D=0ASent: Monday, June 08, 2009 3:17=
PM=0D=0ATo: IDMS-L@LISTSERV=2EIUASSN=2ECOM=0D=0ASubject: Re: COBOL questio=
n=0D=0A=0D=0AKay, I think you can still compile with the assembler code =0D=
=0Aoption=2E That should give you the required addresses=2E=0D=0APaul Wood=
=0D=0AIBM Global Services=0D=0AMainframe Databases, Modeling, Repository Te=
ch=2E Lead=0D=0A=0D=0AHome Office: (714) 876-0497=0D=0Apawood@us=2Eibm=2Eco=
m=0D=0A=0D=0A=0D=0A=0D=0A""Rozeboom, Kay [DAS]"" <KAY=2EROZEBOOM@IOWA=2EGOV> =
Sent by: IDMS =0D=0APublic Discussion Forum <IDMS-L@LISTSERV=2EIUASSN=2ECOM=
=0D=0A06/08/2009 11:43 AM=0D=0APlease respond to=0D=0AIDMS Public Discussi=
on Forum <IDMS-L@LISTSERV=2EIUASSN=2ECOM>=0D=0A=0D=0A=0D=0ATo=0D=0AIDMS-L@L=
ISTSERV=2EIUASSN=2ECOM=0D=0Acc=0D=0A=0D=0ASubject=0D=0ACOBOL question=0D=0A=
=0D=0A=0D=0A=0D=0A=0D=0A=0D=0A=0D=0ACan anyone point me to a tutorial or do=
cumentation on how to =0D=0Afind the location of a working-storage field in=
the load module =0D=0Aof a COBOL program?=0D=0A (As opposed to finding it =
in a dump=2E) I do have a compile =0D=0Alisting available=2E=0D=0A=0D=0AKa=
y Rozeboom=0D=0AState of Iowa=0D=0AInformation Technology Enterprise=0D=0AD=
epartment of Administrative Services=0D=0ATelephone: 515=2E281=2E6139 Fax=
: 515=2E281=2E6137=0D=0AEmail: Kay=2ERozeboom@Iowa=2EGov=0D=0AThis e-mail =
may contain confidential or privileged information=2E =0D=0AIf you think yo=
u have received this e-mail in error, please =0D=0Aadvise the sender by rep=
ly e-mail and then delete this e-mail =0D=0Aimmediately=2E=0D=0AThank you=
=2E Aetna=0D=0AThis e-mail may contain confidential or privileged informati=
on=2E If=0Ayou think you have received this e-mail in error, please advise =
the=0Asender by reply e-mail and then delete this e-mail immediately=2E=0AT=
hank you=2E Aetna
"
IDMS 3rd-party providers forum
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP
IDMSVENDOR-L@LISTSERV.IUASSN.COM
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: COBOL question
"Even batch Cobol programs are quasi-reentrant, meaning the cobol loader
(which is actually the beginning of every cobol program, inserted by the
compiler) relocates working storage into a piece of getmained storage.
That's why she's seeing two versions of working storage.


Lutz Petzold
TDM UDB/IDMS Support
401-782-2265
Page 860 366 0865 or Telalert

Outcomes