Program to search text in the workspace natural

Hi all.

I need to search many analysis of our code-source and a program to search all the code-source in an workspace will make my life better.

Does anyone knows how can I do it ???

Also solve my problem an script to convert the code-source automatically to text. In this case I can process in loop each file and extract the information’s that I need.

Please, someone can help me ???

Best wishes !!

If you just want to search the source code for a particular string, you can do it with the SCAN command.

if you want to read Natural source, you can use USR1057N (in library SYSEXT).

However, XREF and Natural Engineer both provide reports that allow you to cross-reference variables, programs, views, etc.

USR1057N will read a source member into an array. You can manipulate the array (lines of source) programmatically.

USR2019N will read a source member into the Source Work Area (SWA). You can manipulate the SWA with USR1035N or USR2014N. The SWA can be saved via USR2019N.

Hi !

Thanks for the post.

I used the USR1057N and was what I was looking for.
Except for one detail ! in the USR1057P the parameter OPT-AMOUNT is 255 maximumm… I need to process some code-sources with 6500 lines !

:frowning:

Maybe if I convert the programs in roscoe to TXT and process it will function like I need.

Thanks !
I will try this information.
In SWA probably will not have limits of lines.
Because I have to process programs with ~6500 lines.

When using USR1057N, I usually set OPT-AMOUNT to 60, the number of source lines typically found in an FUSER source block on the mainframe.

Place CALLNAT ‘USR1057N’ in a REPEAT loop. Field RETURNED will contain the number of source lines retrieved in the call. Reiterate until you hit logical end-of-file: NAD-MSG.MSG-TYPE = 100.

It´s true and solve the problem …

Thanks for the tips … I am learning Natural since last month and this forum is marvellous.