MOVEX RPG, ADELIA applications, RPGIII,IV, RPGLE , Programs AS400 : Help - Guide : How functions a Process in detail : reverse engineering
 

	WELCOME in « SCAN400 »  Cross References	
 	Practical observation Tool for AS400/iSeries applications - Specialized M3/ Movex
        
       CLICK HERE to RETURN to the original PICTURE-Page CONTAINING this TEXT  
 

Guided Tour - JDSCAN command : used to Set and Run a SCAN batch job , on RPG applications 

to run the screen for settings with JDSCAN , enter from an AS400 Command line :

ADDLIBLE SCAN400
JDSCAN

On the first screen , Choose « 1 » to run a detection of new JOBDs in the system ( it will run for 2 or 3 minutes), 
or choose « 0 » to display JOBDs already  detected previously


The result of the Detection will de displayed on list with each JOBD found on your system :
    in front of each jOBD line, choose one of the following options :

 Y = The JOBD will  be scanned in the next running. If this JOBD was already 
           scanned before, the last result will be erased and re-build (Re-generative)

 N = The JOBD will be  ignored  in the next running.  
           If this environment was already scanned before, the last result will be completely erased

 K =  The JOBD will be ignored in the next running. However, If this JOBD was already scanned before, 
            the last result will be kept

 Z= To display and set new parameters for the cross references  by DB Field for a JOBD

Most of the time you will create yourself your own JOBD with option 1 in the Selector: 
Indeed, «JOBD» means a library list that you frequently  will define yourself, 
for which a true JOBD system does not necessarily exist on your machine.
If you create your own JOBD with option 1, Enter one by one, all the libraries of program objects.
Caution: choose carefully the SORT of object libraires , to determine which program should override another if some different compiled programs exist with the same name in different object librairies.


Option Z in front of any JOBD line will display a new screen in order to, for the JOBD concerned ,
set new parameters for a scan detecting the cross references by Data base FIELD, 
that will be added to the main scan cross references by programs.
Enter « Z , in front of any line containing the name of the JOBD you want to set: 

Then , you will have to enter new informations in this new screen such as:
- A Sources library list
- A Data librairy list

Enter one by one, all the sources libraries for all the programs assumed to contain a use of DataBase Fields in their source code syntax, and all the Data libraries assumed to be used by those programs.
The Scan will cross these two kinds of information, to collect and qualify all the line source codes concerned. Then, use JDFIELD to consult the result of this inventory.
Caution: choose carefully the SORT of the SOURCE libraries too , in order to determine which source member should override another during the scan, if some different sources programs exist with the same name in different source librairies.

The Scan collecting the cross References by D.B fields needs imperatively at least :
	- At least one Source library 
	- At least one Data libray 

If this minimum required is not provided, a warning message appears when you want to exit. Press F12 key to exit , return to the main procedure and go to the next step.


a batch Job « JD_SCAN » is then launched in the Jobq  QS36EVOKE , in HOLD state,
 that you will have to release manually.

Of course, this JOB can be Scheduled in your nigth work Jobs (WRKJOBSCDE).
To see how plan /schedule  periodically at night this job, see the page about the global batch SCAN
 
The time to scan a JOBD with a big library list can be between 30 minutes and 1 hour,
according to your settings (scan of Data base Fields or not) , and to your Iserie abilities.  
You can plan a daily Scan , but a weekly Scan is also a good choice.  


In JDSCAN, you can specify your SQL library source (and the DATA library relative to it)  for a JOBD name (option 'Z' in front of a JOBD on the screen 'choice of JOBDs/ programs librairies‘ in JDSCAN).   

As well as for the order of object libraries, the sequence order of SOURCES libraries is important : it determines which source will  
be considered if different source members have the same in different libraries.  

The order of sequence order of libraries objects must be coherent with the sequence order of sources libraries :  SCAN400 uses these theses two orders of sequence to locate the source program for an object program.  Only if this method fails, SCAN400 would then try to find the source from the information from the object (DSPOBJD)

     SCAN400 prefers to locate the source from an ordered list rather than by DSPOBJD , for the following reasons:

   - Be able to remark that a program object have a version of source code that has evolved , and is not re-compiled yet   
   - Resolve the problems of sources members re-named or moved,  making obsolete the veracity of informations retrieved from DSPOBJD


After a SCAN , use JDFIELD to consult Cross references by Database Fields, or use JDSEE to consult the Cross references inter-programs.

the « SQL » type sources are now scanned by JDSCAN (results to observe in JDFIELD) : 
       if some Data Base fields exist in the syntax of SQL sentences, these sentences are 
       collected by the Scan.

The SQL sentences are detected :

In  source members with the type « SQL » ,   « SQLRPGLE » or « SQLRPG » mentionned.
In source members without type mentionned (type is blank), but only if they exist  in a Source file named « QSQLSRC »

JDFIELD presents also detected Data Base Fields existing in CL, CLP or CLLE programs source code lines , detecting database Fields such as « &DBFIELD »