Application Engine Concepts

     1.How can we call a section dynamically in app engine?
Use the AE_APPLID and AE_SECTION fields in the state record to execute different sections depending on the conditions a program encounters during runtime.
These two fields must be defined on the default state record for the program. If AE_APPLID is not present or is blank (at run time), the current program is substituted for the AE_APPLID value. If AE_SECTION is not present or is blank, an error occurs.
When issuing a dynamic call, both the section and the Program ID must be dynamically set. You enable a dynamic call by first having your program store different section names in the AE_SECTION field, and different program names in AE_APPLID field. The values you insert in these fields are normally based on various conditions met within your program. You then create a Call Section action that calls the section name defined in the State record field by selecting the Dynamic check box.

Selecting dynamic automatically populates the AE_SECTION field with the symbolic value %Section, and the Program ID field with the symbolic value %AEAPPLID. At runtime, the program calls the section name stored in AE_SECTION that belongs to the program name defined by  AE_APPLID.
2.What we have to do for restart facility?
Program level:
One state record should be sql table.
On the advanced tab in the program properties dialog box make sure that disable restart is not checked
      In configuration manager make sure that disable restart is not selected on the process schedular tab
Section level:
The options for section type should be prepare only and critical updates.
If the section is only preparing data as selecting it populating temporary tables or updating temporary tables the section type should be prepare only.
If the section is updating permanent application tables in the database we should select critical updates.
Step Level:
We need to have some conditions that reduce the answer set returned by the doselect
Add and order by clause:
%select field1
select field1
from ps_some_record
where field1>%bind(field1)
order by field1
Add a switch to the selected table
Select column1, column2
From ps_table1
Where processing_switch = ‘N’
Delete processed rows.

3. What code we used for restart facility?
%select field1
select field1
from ps_some_record
where field1>%bind(field1)
order by field1
Add a switch to the selected table
Select column1, column2
From ps_table1
Where processing_switch = ‘N’
Delete processed rows.

4. What is set processing?
Set processing is nothing but processing sets of rows at one time rather than processing each row individually. Set processing enables you to apply your business rule directly on the data (preferably while it resides in a temporary table) in the database using an update or insert/select statement. Most of the performance gain is because the processing occurs in the database instead of loading the data into the application program, processing it, and then inserting the results back into the database tables. Because the data never leaves the database with set processing, you effectively eliminate the network round trip and database API overhead.
Note. Because the updates in set processing occur within the database, PeopleSoft encourages you to use temporary tables to hold transient data while your program runs. Although temporary tables are not required for set processing, they are often essential to achieve optimum performance in your batch program. The only select statements used in set processing appear in sub queries of an insert and update statements,
5What is parallel processing?
The ability for multiple instances of the same programme to run simultaneously is called parallel or concurrent processing.
Define the following Meta sqls
  1. %Bind        :       for retrieve data from the state record
  2. %Select     :       Inserting values into state record
  3. %Table       :       For referencing a table across multiple databases
  4. %Truncate  :      To delete the temporary table
  5. %DateIn     :       Where dt is either a Date value or a date literal in YYYY-MM-DD format,                                    expands into platform-specific SQL syntax for the date. %DateIn should be                                 used whenever a date literal or Date bind variable is used in a comparison in                             the WHERE clause of a SELECT or UPDATE statement, or when a Date                                   value is passed in an INSERT statement
  6. %DateOut   :      Where dt is a date column, expands to a platform-specific SQL substring                                   representing dt in the SELECT clause of an SQL query.
  7. %Mode      :       Gives the correct user action Mode, like add/update…
  8. %Execute edit:    Enables People Soft Application Engine to support data dictionary edits in batch
  9. %Join      :          Expands the join dynamically while executing this Meta SQL
What are the select types of the DO SELECT?
1. Select/fetch
2. Reselect
3. Restartable

What is Select/fetch?
Select and fetch opens the cursor to the database.
Selects the first row that meets the sql condition in the Do Select. 
Executes the actions in the step (call section, sql, etc). 
Once the subsequent actions are completed the program returns to the open cursor from the Do Select, retrieves the next row and continues again with the rest of the actions.

What is Reselect?
Reselect opens a cursor to the database.
Selects the first row that meets the sql condition in Do Select.
Closes the cursor.
Executes the following Actions in the step (Call Section, sql, etc)
Once the subsequent Actions are completed the program returns to the sql in the do select and opens a cursor again.

What is Restartable?                                                                                 
It will acts like select and fetch but the only difference is we will use this with reselect option.

What is the purpose of the Do While?
It is a SELECT statement that runs before subsequent actions of the step. The subsequent actions within the step are executed in a loop as long as the SELECT statement returns at least one row for the Do while action. Do While is nothing but a While Loop.

What is the purpose of the DO until?
A Do until action is a Select statement that runs after each action when a step completes. If the Select returns any rows of data, the step terminates. Do Until is nothing but a Repeat Loop.

What is the purpose of the Do When?
The Do When action is a SELECT statement that allows subsequent actions to be executed if any rows of data are returned. This is the first executable statement with in the step. Do when is nothing but an If Loop. It contains SQL that tests for a condition. If the condition is true then it returns a row of data, and it executes the subsequent actions within the step. If the condition is false then no row of data returned and it terminates the entire step. If there are no more steps to execute, the program will end.

What is the purpose of the SQL action?
SQL Statements are used to perform the DDL, DML, and DCL operations. Majority cases we are using the DML commands (UPDATE, DELETE, INSERT, SELECT).

What is the use of the Call Section?
Call Section is used to call one section from another section. The "called" Section can be in the same program as the calling Section, or it can be in an external program. If a Section already exists in one program, rather than copying it into another program, just call it.

What is the use of people code action in A.E program?
People code provides reusing common faction libraries of A.E program. And used to build dynamic SQL performs simple if /then/else edits set defaults and perform other tasks that don’t required trip to the database.

What is difference between Do select and SQL?
The Do Select action is a SELECT statement that executes subsequent actions once for every row of data that the Do Select returns. It works like a FOR loop. It returns a row. Do Select is a test condition. Where as SQL executes DML and Meta SQL.

What is difference between call section action and dynamic call check box?
Call Section is used to call one section from another section. The "called" Section can be in the same program as the calling Section, or it can be in an external program. If a Section already exists in one program, rather than copying it into another program, just call it.

Use the AE_APPLID and AE_SECTION fields in the state record to execute different sections depending on the conditions a program encounters during runtime.
These two fields must be defined on the default state record for the program. If AE_APPLID is not present or is blank (at run time), the current program is substituted for the AE_APPLID value. If AE_SECTION is not present or is blank, an error occurs. 
When issuing a dynamic call, both the section and the Program ID must be dynamically set. You enable a dynamic call by first having your program store different section names in the AE_SECTION field, and different program names in AE_APPLID field. The values you insert in these fields are normally based on various conditions met within your program. You then create a Call Section action that calls the section name defined in the State record field by selecting the Dynamic check box.
Selecting dynamic automatically populates the AE_SECTION field with the symbolic value %Section, and the Program ID field with the symbolic value %AEAPPLID. At runtime, the program calls the section name stored in AE_SECTION that belongs to the program name defined by AE_APPLID.





No comments:

Post a Comment