Searching for variables in LIST EXPAND

Hi,

Usually the programs use many LDAs and each LDA contain many variables.
During analysis some times it is really difficult (time consuming)to find in which LDA the variable is defined (by listing each LDA).

Is there any approach which can ease the search by not leaving the editor or not listing each of the Data areas?

(EXPAND is useful only in LIST mode and we can not SCan the variables with the EXPAND command).

Thanks in Advance.
Mishra

do you have XREF on? This feature enables you to cross reference programs, variables, views, modules, etc.

To use it, you need to have the objects in question STOWed with XREF=ON, then use the LIST XREF command to produce the reports.

An XREF can include false hits. That is, the variable in question may reside in 10 LDAs, but only one of those LDAs is in your module.

Another option is to list the module in batch with

L module EXPAND 

Then scan the softcopy listing for the variable.

Or you could write a utility to

  • . search the contents of the Source Work Area for external data area names
    . determine the variable name by the cursor position in the editor
    . search each external data area for the variable
    . display a pop-up window with the results

Or you could purchase a third-party solution.

Hi,

Thank you for your responses.

The LIST module EXPAND seems a nice option to go with.

Thank you,
Mishra :slight_smile:

Hi Mishra

If you are looking for a quick way of finding a variable without leaving the editor, then I have something that works 99% of the time.

What I think you are describing is a case where you have something like this:

0010 define data
0020 local using lda1
0030 local using lda2
0040 local using lda3
0050 local using lda4
0060 local using lda5
0070 end-define
0080 write #a #b #c #d #e
0090 end

where you don’t know where one of the variables, say #b, exists. Assuming the code already checks, just insert a new variable named for the one the are looking for just after the define data statement, something like this:

0010 define data
0011 local
0012 1 #b (i4)
0020 local using lda1
0030 local using lda2
0040 local using lda3
0050 local using lda4
0060 local using lda5
0070 end-define
0080 write #a #b #c #d #e
0090 end

It doesn’t matter what you define #b as, the only requirement is that it’s defined in front of the other data areas. If you now simply check the code, you’ll get a 283 error saying that the variable has been defined more than once and when you hit enter or return, Natural will mark the LDA where the second occurence has been found. Not elegant, but it’s a quick way of finding out where your variable is!

Hi Paul,

This is a trick for a quick check…thank you very much :slight_smile:

Thanks,
Mishra