In order to fix code many a times one needs to search for terms, function names, defect/case ID's etc in SQR/SQC/INC (henceforth referred to as SQR files) files.
TextPad allows one to search thorough folders containing files having certain terms (e.g a defect ID or a case number) which is suspected to be related to a bug. However this process is often very slow as TextPad needs to open each and every file one by one and parse through it.
If there was a way by which we could index all terms in SQR files and store them upfront the amount of time required to search problem areas in SQR's and fix them could be drastically reduced.
Fortunately there are two free tools one could use to index these files. The first is an open source tool called Lucene and the second is Microsoft's Indexing Service that comes by default with the Windows XP operating system.
Lucene though very powerful needs knowledge of Java to build an application which would fit our needs.
Microsoft Indexing Server on the other hand is simpler to configure. The service can be accessed through Control Panel --> Administrative Tools --> Computer Maintainence. All one needs to do is create a new Catalog and add the directories which have the SQR files. The indexing service keeps a track of any changes made to the files and updates the indexes automatically. However, one needs an IFilter implementation to read SQR files even though SQR files are as good as text files. There is one workaround though. Change the file extension from .SQR to .SQR.TXT.
If you want to search on the index, all one needs to do is query the catalog and presto you can search through all the code that resides in your SQR files. Only those files which have the term would show up in the search results.
To take it one step further one could write a program to use this index and highlight terms in the file.
If you are wondering what Object Types are they are nothing but your usual objects that you create through the application designer or the PIA.
You might be wondering okay so why am I writing a blog on this.
Well here's why. Have you ever wondered how PeopleSoft stores the records, fields, pages, componets etc in the database. In an earlier blog I had mentioned about where PeopleSoft stores all your projects and objects that belong to your project.
Object Types in the peoplesoft are stored as numbers where each number stands for a certain object.
After snooping around in the database as well as google I have finally managed to collate a list of almost all the object types that are generally used.
The list is available here.
More often than not I had situations where I needed to literally step through the application engine looking at the sections and steps that got exected under differnet conditions just to confirm if the logic applied to build the Application Engine (AE) was right or wrong.
So here are the steps and parameters I use to do just.
First, you need to set PSAE.exe which actually initiates your AE in your environment variables. I am assuming you are using Windows XP.
How would you set the path to point to the folder which houses PSAE?
1. Right Click on My Computer on your desktop and then click on Properties.
2. Click on the Advanced tab.
3. Click on Environment Variables.
4. Under System Variables look for Path.
5. Double Click that entry and append (I said append not overwrite) the folder path which has PSAE. On my system I had the executable under " C:\PT8.46\bin\client\winx86 ".
Now that you have everything setup to debug your application engine open the command prompt.
Type psae and press enter. If you get a message like :
Invalid command line argument list. Usage:
psae -CT <dbtype>
-CS <server>
-CD <database name>
-CO <oprid>
-CP <oprpswd>
-R <run control id>
-AI <program id>
-I <process instance>
-DEBUG <Y|N>
-DR <Y|N>
-TRACE <value>
-DBFLAGS <value>
-TOOLSTRACESQL <value>
-TOOLSTRACEPC <value>
-OT <output type>
-OF <output format>
-FP <file path>
or
psae <parmfile>
-(RE)CONVERT <product>.<appl id> (e.g. AE.TESTAPPL)
Congaratulations you have just finished the first hurdle.
If you notice the error you get on the screen is quite intuitive.
Of all the options mentioned -CT, -CD, -CO, -CP, -R, and -AI are mandatory to get your application engine working.
Note: The order of these parameters is immaterial.
If you are trying to restart an application which had abended for some reason by supplying the correct UserID, pwd, run control id and process instance you can rerun the application engine.
If you want to step through each and every step that the AE would execute in realtime just plug in the -Debug option.
Once you are in the Debug mode and have initiated your application engine to know what choices you have just type '?' for help.
Hope this helps.
Many a times I have heard people new to PeopleSoft say that one cannot run an application engine using the same Run control ID. I would like to say to them that is it B.S .
The reason why an application engine often does not run with the same run control id is that a previous instance of the same application engine might have gone to error with the same run control id.
If at all this happens and you still want to run the application engine it can be done through the command line if all else fails.