View previous topic :: View next topic
|
Author |
Message |
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Hi All,
I have been given a problem.
The Problem is, I have a value, and from that value i have to find which variable is having that value.
for example, I have been given a number 134454, and now I am being asked to find out the variable which has that value.
As of now, I am doing hit and trial, but it is very timeconsuming. So just wanted to know, is there any option by which we can trace it.
Please note, we don't have xpeditor, so maximum I can do is, give displays, and then search for value.
Regards,
Tushar |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
saurabh39 wrote: |
So just wanted to know, is there any option by which we can trace it. |
Yea, sorta, but it depends on what you are looking at..... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
it's not clear what do you want to do? You have posted in Mainframe COBOL part of the Forum but you this statement
Quote: |
have been given a number 134454, and now I am being asked to find out the variable which has that value. |
makes me think as if you are talking about ISPF 3.14 option kind of stuff, are you? |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
@Anuj - Let me make more clear.........
In my application, we calculate premium and it comes out to be some value say 134454, now business is saying the value is incorrect and it should be something else. But the tables from which the data is arrived is correct. So the problem is happening in my application.
One way to find, from where the value is coming is by giving displays, and displaying all the numric value, but this is a tedious task, so I want to know, is there any way by which I can know, which variable is having the said value, and then by knowing the variable, I can know, where the wrong computation is happening. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
oh, the way I'm understad it is -
1. it looks like you've some program which read some input file, picks up some values to caluculate the "premium" number.
2. Your program do some calculation/manipulation on the data it reads.
3. There is a COBOL-program-variable "which has the value to searched for", during the execution time.
4. You want to know, from which cobol-variable you get that value? |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
Yes Anuj, you understanding is correct. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
You want to know, from which cobol-variable you get that value? |
normally, one looks at the logic of the program, and determines which variable provides the value. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
1. Well, use xpeditor and "keep" the variable you want to look for.
2. put the Displays.
3. Check for logic. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
or if you don't have expeditor,
determine where the value comes from - desk checking, following the logic
run you test,
having displays based on an IF statement comparing the variable to the 'bad' value,
that also display the pertinent fields used in the calculation,
so that you can find your logic error.
the displays and the IF statement can be debug lines (d in col 7)
and use the Source computer clause WITH DEBUGGING MODE
to allow you to move the module to production
with only changing the SOURCE COMPUTER clause. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Unless you have some form of run-time analyzer such as Xpediter, be aware that what you are wanting can be a very complex, time-consuming and expensive task -- especially since you seem to have no idea which variable(s) you need to monitor. There is no easy way to do this other than painstaking desk checking or many DISPLAY statements. |
|
Back to top |
|
|
saurabh39 Warnings : 1 Active User
Joined: 11 Apr 2008 Posts: 144 Location: Jamshedpur
|
|
|
|
I was able to find out the culprit, by using displays...but as robert said, its quite complex nd time consuming. Thats why, I thought of asking the problem....and to see if there is any better way.
@Anuj - From Xpeditor, we can find the value of a variable, but finding a varbiale, which has certain value(as in my case)...i guess we cannot do it from xpeditor. Moreover, Xpeditor is not activated at my site, so could not try also.
I guess, for my problem, there is no staright solution, but to do the tedious task of anylyzing the program, giving displays of the variable, which I think may be culprit, and then keep on executing until and unless I nail it. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Glad to hear that you got it working.
Quote: |
@Anuj - From Xpeditor, we can find the value of a variable, but finding a varbiale, which has certain value(as in my case)...i guess we cannot do it from xpeditor. Moreover, Xpeditor is not activated at my site, so could not try also. |
It's like saying - egg came first or hen? However, in this case we are lucky to know that what data "program can read" and what is the expected output. But to understand, what is happening, under the covers, with the values in "programs' intermediate-varaibles" is programmers responsibilty - but if you have not written the program then ofcourse it needs a little amount of work from you. And for suh work, it's usually, (not always because if you've written the program sometime you can tell that) a road from "variable to value" and not vice-versa. So yes, xpeditor can't do that. |
|
Back to top |
|
|
|