M3 ERP , Lawson Infor : Help - Guide : Analyze your specific and Standard programs 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 « SCAN400 – Cross References » - Detection of indirect CALLs > SCAN400 can identify Indirects CALLs used in your programs. The indirect CALLS are inter-programs CALLs that are not detectables by the standards methods. For example: For RPG : CALL that are not detectable by using DSPPGMREF AS400 command For M3 : APCALL using a variable field instead of a literal word in the CALL syntax The detection of indirect CALLs usually represents very few cases (less than 1% in M3 or ou Movex), But makes the Tool even more complete, and highlights what is very specific to a ERP software, a company, or a way of coding Examples of possible detections : M3 programs calling RPG programs RPG programs calling M3 programs Programs calling other programs through a variable field (M3 or RPG*) There are two kinds of indirect CALLs : The LOGICAL indirect CALLs : it means thatSCAN400 can automatically find them with no help The SPECIFIC indirect CALLs: it means that SCAN400 need a setting that you must provide, in order to help for the detection of this kind of Call. The two kinds of indirect CALLs For the two kinds of indirect calls presented below, the literal syntax 'CALLED_PROGRAMME_name' must be detected : 1- Case of LOGICAL indirect call - example : MOVE the literal 'CALLED_PROGRAM_name' in &VARIABLE and further in the source code : CALL &VARIABLE 2- Case of SPECIFIC indirect Call, that means a way of coding specific to a Software , ERP : this specific way of coding must be identified through a SETTING previously provided. example: MOVE the literal 'CALLED_PROGRAM_name' in &VARIABLE and further in the source code : CALL 'LAUNCHER_PROGRAM_name' passing as parameter &VARIABLE A typical example of indirect specific CALL in M3 or Movex RPG, is the calling programs through the launcher MNS230: although calls via MNS230 are already identified in the standard motor of SCAN400 for M3, it is not the case for RPG : if you scan a RPG Movex application, it will require a setting to specify how indentify theses indirect calls. Sample of source code in the RPG program APS100 : GLS040CL called through MNS230 (indirect CALL specific to Movex) : MOVEL 'GLS040CL 'PXPGM and further in the source code : CALL 'MNS230' PARM PXCONO PARM .... PARM PXPGM Unlike the specific indirect calls, logical indirect calls can be detected by SCAN400 without having it do need to specify a setting . Here is an example of logical indirect call: extracted from the source code of SOS620 in Movex RPG: CALL 'CRS155' PROG Here, the CALL variable « PROG » is filled with the literal ’ CRS155’ And further in the source code: CALL PROG Here, CRS155 is inderectly called through the variable « PROG » By definition, an indirect call is opposed to a "direct" call which would have the following syntax: CALL 'CRS155' CHOOSE the KEYWORDS to DETECT indirect specific CALLs in RPG Applications (unknown from the default SCAN using DSPPGMREF) if an indirect Call is specific to your RPG appli, you must tell SCAN400 how identify this kind of syntax, through the setting shown in the picture above, that will present you JDSCAN command in step 3. Then Press : - F6 to create a setting line after having filled each selectors - F5 « See Example » to read help and undersatnd how to fill the selectors Note: To enter this kind of setting for RPG , you enter words : A word can contain any special characters , but no Blank character inside. The first non-Blank character is the beginning of the word, and its end is also the last non-blank character. Example : when you enter : " ABC.#DEÀ " , this represents the word «ABC.#DEà» (NB: you can only type uppercase letters in selectors because the scanned sources will be converted and compared to uppercase characters, Except for “À “ converted to lowercase “à “) The SCAN will search inside the source code, some values between DOUBLE QUOTES named LITERAL, in association with a WORD that identifies a CALL SYNTAX (LITERAL+CALL SYNTAX in a same code Line) Each LITERAL will be identified as a CALLED Program, providing that the VALIDATING WORD is found at less one time in the program source code. Let blank in the optional VALIDATING WORD if the WORD in a CALL SYNTAX is enough to identify a specific CALL. Sample of indirect CALL in RPGLE source code : D PROCEXT1 PR EXTPGM('PROCEXT1') This line , in card D, indicates that a procedure will be called. HOW to register the Setting for this sample: WORD in CALL SYNTAX = EXTPGM Word linked to the literal 'PROCEXT1' which is the Called program to detect VALIDATING WORD = PR , to validate that EXTPGM is a CALL syntax. After a SCAN on your RPG* applications, all indirect calls (logical or specific) are collected: Run the command “JDMORE" from a command line to display the result of all indirect calls identified : you can then enable or disable each identification.