DATA Step, Macro, Functions and more

Where Used of fields in code

Reply
Frequent Learner
Posts: 1

Where Used of fields in code

Hi -

How can I scan through all my programs and identify which programs use a certain field?

Janet
Super User
Posts: 5,441

Re: Where Used of fields in code

If your programs is not generated by DI Studio, the easiest would probably to use OS tools, such as the search facility i Windows Explorer, or in UNIX various shell commands.

/Linus
Data never sleeps
Respected Advisor
Posts: 3,799

Re: Where Used of fields in code

I use ULTRA EDIT it has a nice "Find in files" feature. I've been using it quite a bit lately.

You can also use SAS to search. I used FIND but there are other functions if you need more sofisticated searching.

[pre]
filename FT33F001 'b*.sas ';
options notes=0;
data _null_;
length Filename $128;
infile FT33F001 filename=filename eov=eov;
input@;
if _n_ eq 1 or eov then do;
line = 0;
eov = 0;
put;
put 'NEW FILE: ' Filename=;
end;
line + 1;
if find(_infile_,'summary','i') then do;
put +10 line=;
list;
end;
run;
options notes=1;
[/pre]
Regular Contributor
Posts: 241

Re: Where Used of fields in code

@janetS: I am not sure if the source text scanning would be sufficient. Variable lists, arrays and other variable naming shortcuts let us code without explicitly mentioning individual variable names. I would refine what I mean by "using a variable", and then proceed more cautiously.
Ask a Question
Discussion stats
  • 3 replies
  • 144 views
  • 0 likes
  • 4 in conversation