Thursday, February 7, 2013

SQR Interview Q & A


1. What is SQR? Features of SQR?
   SQR (Structured Query Reports) is a programming language used in data processing and data reporting. 
   SQR program can execute multiple queries.
Features:
          i) More flexible
          ii) Scalability for Client and Server architecture.
          iii) Multiple platform portability
          iv) Multiple RDBMS portability
2. What is a FLAG?
It is an attribute given to programming for processing and generating output destination file.
3. What is difference between .LIS and .SPF file?
. LIS (list file) is used for line printer execution. Normally it is used for printing cheques.
.SPF file is portable format, this is used for all window-based applications with any printer. Normally it is used for MSPAINT, Image, and Graphics.

4. How many types of SQR files are there?

There are 5 types of SQR files

. SQC: SQC program files contain commonly included procedures that are called by other SQR programs.
. LIS when an SQR reports generate output it is sent to a file with an. LIS extension.
. LOG: SQR.LOG file is the output file used by People soft. This file contains all information such as errors and displays statements. That is output to the terminal during the execution of SQR.
. MAX: SQR does not dynamically allocate memory. The default program allocations (which were coded for lower        DOS memory) usually have to be increased for complex SQR programs.
Note: People soft uses a .MAX file to increase any SQR parameter where default is not adequate for the program. There is one main .MAX file for processing under SQR W (windows) called ALLMAXES.MAX
. SQT: These program files are precompiled SQR programs. As a People soft 5+ there are no delivered precompiled SQR programs.
5. Explain briefly about flags?
The SQR command supports several flags. Each flag begins with a dash (-). Flags with arguments must be followed directly by the argument with no intervening space.

SQR Command-Line Flags
Flag Description
-A Causes the report output to be appended to an existing file of the user name

-Bnn (Oracle,SYBASE CT-Lib) indicates how many rows to buffer each time data
is retrieved from the database. The default is 10 rows.

-C Specifies that the cancel dialog box appear while the program.

-CB (Callable SQR) forces the communication box to be used.

-DEBUG (xxx) (Sybase) Causes lines preceded by #DEBUG to be compared. Without this
flag, these lines are ignored.

-E(file) Causes error messages to be directed to the named file, or to the default file
report errs. If no errors occur, no file is created.

-F (file) (Directory) overrides the default output file name program .lis

-KEEP In addition to .LIS files, creates an .SPF file for each report that your
program generates.

- LOCK(RR]CS]RO]RL]XX] (SQL Base) Defines the types of locking (isolation level
for the session.

-NR (SQL Base) specifies that the No Recovery mode is used when connecting to the database.

-XCB Do not use the communication box.

-XL Prevents SQR from logging on to the database. Programs run in this
mode cannot contain any SQL statements.

-XMB Disables the error message display so that a program can be run without
interruption by error message boxes.

-XP (SYBASE DB-Lib) Prevents SQR from creating temporary stored pro-
cedures.

-XTB Preserves the trailing blanks in an LIS file.

-ZIV Invokes the SPF viewer after generating program .spf file. Using this flag
implicitly invokes the –KEEP flag to create program .spf file.

-ZMF(File) specifies the full path and name of the SQR Error Message file. The Sqr
err.dat located in the directory indicated by the SQR DIR environment
Variable is the default.


6. How SQR Programs are evaluated and executed at different times?
FIRST PASS: Or Compile stage. SQR processes the following components of the program.
1. All # include external source files (SQCs) are inserted into the source program.
2. All # commands are evaluated.
3. The setup section is processes including allocation and population of memory arrays created by the load-look up command.
4. Optimization of the SQL data access path is determined.
5. Checks syntax of SQR source program.

SECOND PASS: Actual execution of the program source occurs starting at the begin
Report stopping at the end-report.
1. Process data for the body section.
2. Senses page overflow or response to new-page command in code.
3. Process heading section
4. Process footing section
5. Writes entire page buffer to file.
7. How many types of SQR data elements are there?
Columns, variables, Literal
8. What does SQR report structure(program) consists of or Types of sections in SQR Program?
Report or Program – Determines where SQR will begin and end execution of your report. People soft uses this section to control the flow of processing by calling procedures using the do command, thereby utilizing modular programming.
Setup Section – Contains commands, which describe the general report characteristics (Note: the setup section is preprocessed and is automatically run before the program begins execution. This section can only include SQR commands.
Programming section –
A – Begin – SQL: The SQL paragraph allows you to execute any non-select SQL
Statement.
B. Begin-Document-: Allows you to mix background text. With the data retrieved from the database.
C. Begin-Select: Select paragraph is the heart of the SQR program. For each row of data retrieved from the query, acting as an implicit while loop may also process a set of commands there. Here you specify what columns of data to retrieve from the database. Other procedures may be referenced within a select paragraph, which in turn may contain other select paragraphs.
Note: In begin select SQR requires that columns names be flesh to the left margin and SQR commands be indented.
Heading Section
Footing Section
Procedure Section : A procedure is a list of commands or paragraphs, which are processed when referenced by a corresponding, do command. Procedure names must be unique. Procedures can contain regular SQR commands as well as three special kinds of paragraphs: A. SQL B. Document C. Select
9. Explain Print Function?
The print command, is both explicit and implicit, is the focal point for formatting and processing.
Explicit print is used to print database column referenced by its pseudonym (&column name) or a user defined variable.
The Implicit print is only valid for database columns as they are retrieved in the select para.
10. What are positional co-ordinates?
Printing in SQR is placing output on the page grid. Position syntax is used to define where to place data on the page within a given section.
11. Explain briefly about On-break processing?
On-break option on columns will cause each column to break independently from each other. When a break occurs the following happens, After procedure are processed in descending sequence from the highest level to the level of the current break filed.
12. Difference between ASK V/S INPUT?
ASK : It is requests the user for the value and substitutes the value during compilation. It is used only in the setup section.
INPUT : It requests the user for the value at runtime. (i.e., at execution stage). It can be used anywhere in the programming section.
Note: INPUT is mere efficient than ASK.
13. Define an Array?
An Array can be defined to store intermediate results or data retrieved from the database.
14. Define Process Scheduler?
It is an centralized tool that enables application developers, system administrators and application users to manage People soft batch process. Process Scheduler enables you to schedule running process and create job.

15.Difference between Process and Job?
Process: A process is a single task, program or routine (such as SQR reports or Batch Cobol) that runs either on client or server.
Job: It is one or more process of the same or different type, which can run either in series or Parallel. (A group of process can be combined and run as process job)

16. What are the sections and paragraphs available?
There are five sections and three paragraphs available in SQR programming. The sections include

a. Begin-setup End-setup.
b. Begin-program End-program.
c. Begin-procedure End-procedure.
d. Begin-heading End-heading.
e. Begin-footing End-footing

And the paragraphs include

Begin-select paragraph.
Begin-SQL paragraph.
Begin-document paragraph
17. Is it possible to increase the array size once defined?
No, it is not possible to increase the Array size once defined
18. What is Load-lookup? Give the Syntax for Load-Lookup?
The LOAD-LOOKUP command defines an array containing a set of keys and values and loads it into memory. With LOAD-LOOKUP, you can reduce the number of tables that are joined in one SELECT. Use this command in conjunction with one or more LOOKUP commands.
Syntax: begin-setup
load-lookup
name=prods
table=products
key=product_code
return_value=description
end-setup
19. Can you Call a SQR from another SQR? How?
We can call one SQR program from another SQR program using Call.callsystem. But this is possible only in UNIX Operating system.
20. Briefly explain Most commonly used SQC's in SQR programs?
: Some of the most commonly used SQC's are
1.STDAPI.sqc : This Is Process Scheduler Interface which is used to initiate and terminate some field values such as Process_instance & Run_cntl_id
2.SETENV.sqc : This is used to set the Default Environment based on the Database such Printer Type, Paper Size,Date formats Etc….
3.NUMBER.sqc : This file contains generalized routines to format numbers.
4.DATETIME.sqc : This file contains generalized routines to format dates and times.
6.RESET.sqc : This is an important Footing SQc.
21. What are the commands used in filehandling of sqr?
Using File Handling we can Import. Steps are
1. Opening a File Using 'OPEN FOR-READING' command.
1. Reading Data From File Using 'READ' command.
Writing Data into Table Using 'BEGIN-SQL' paragraph & 'INSERT' command
22. What are On-break parameters?
ON-BREAK causes the specified action to perform in a tabular report when the value of a field changes. The default action prints the field only when its value changes (PRINT=CHANGE).Mainly used for Redundancy of Printing on a page.
23. How can you Debug SQR programs?
We can Debug SQR using Debugging Commands such as
2. #IF DEBUGxxx
#END-IF
2. DISPLAY and
3. SHOW
24. What is the difference between sqr and sqc?
SQR SQC
1.This is nothing but the Actual 1.This is like a function in SQR.
Source program.
2.This consists of Program Section. 2.This does not consists of program Section.
3.This can be Compiled & Executed. 3.This cannot be Compiled and Executed.
4.We cannot call one SQR from 4.We can call one SQC from another SQC or another SQR
or SQC. SQR program.
25. What are different types of variables in sqr?
Types of variables in SQR are
1. Column Variables.
2. List Variables.
3. System Variables.
4. Document Variables.
5. Substitution Variables.
User Defined Variables
26. Is there any read-only variable in sqr?
Column Variables & System Variables are Read-Only Variables.
27. How to pass Inputs for sqr program while running from windows?
Using ASK & INPUT Commands.
28. How to pass Inputs to the SQR while running through the Process Scheduler?
Using Procedures & SQC's to access data on Run Control Page (Run Control Fields).
30. What is the purpose of Stdapi.sqc
This is a Process Scheduler Interface sqc which is used to initiate and terminate some field
values such as Process_instance & Run_cntl_id
31. What is the SQT file? What are the advantages of SQT files?
SQT' file is nothing but resultant file after the compilation (i.e.) Runtime File. By using this SQT file for Execution we can increase the Performance of the program by reduciong the Compilation Time.
32. What is the SQC used to read data from translate table?
'READXLAT.sqc' is the SQC used to read data from Translate Table.
33. Which section is mandatory in an SQR program?
'BEGIN-PROGRAM' Section is Mandatory for an SQR program.
34. How will you display an image in SQR?
Using 'DECLARE-IMAGE , END-DECLARE' command.
35. What is use of SETENV.SQC?
This is used to set the Default Environment based on the Database such Printer Type, Paper Size, Date formats Etc….
36. How will you perform ERROR handling in SQR?
We can do Error handling in SQR using some command line flags such as –O, -L,-ZMF,-XMB and using Error handling commands such as
ON-ERROR = Skip/Warn/Stop (for Compile time errors)
ON-ERROR = Procedure Name (for execution stage errors).
37. How many ways of performance tuning are there in SQR?
1. Using LOADF-LOOKUP & LOOKUP.
2. Using ARRAYS.
3. Using MULTIPE REPORTS.
4. Using SQT Files.
5. Using –Bnn Command line Flag.
6. Running on BATCH SERVER.
7. Using Proper Programming Logic in SQR such as Using BREAK statement in EVALUATE Command.
8. Proper SQL tuning such as using Sub queries instead of Joins.
38. Can you call procedure in oracle from Sqr? How?
To call a database procedure using Begin-select paragraph, the syntax is as follows:
Begin-select
[(report arguments)]
from Dual
End-select
To call from Begin-sql, the syntax will be
Begin-SQL
;;
End-SQL
39. Can you connect more than one database using one Sqr? How?
Yes.
40. What are the differences between Load lookup and Array

ARRAYS LOAD-LOOKUP

1. Arrays can be declared in any section. 1. Load-Lookup is declared in only in
SETUP section only.
2. Number of rows are not automatically 2. Numbers of rows are automatically added. gives a error if the number of added.
Exceeds the specified number.
3. We should insert data in to Array by 3. Rows are automatically inserted in to
programming. Load-Lookup.
4.We can retrive any number of fields. 4.We can retrive only Two fields from
from a table. a table.
5.We have Length & Data type. 5.We don't have Length & Data type.
6.We cannot directly print from Array. 6.We can directly print from
Load-Lookup.
41. What are the steps required to run the SQR from peoplesoft environment?
Three steps we have to fallow to run the SQR program from the peoplesoft environment (Process Scheduler). These steps include
a. Making the SQR program API aware by calling two procedures (stdapi-init, stdapi-term) from the Begin-program section and including the Stdapi.sqc in the bottom of the program.
b. Create new run control table or using existing run control table and creating run control page, component and register the component. Creating new run control SQC if we create a new run control table.
c. Giving the permission to the user by giving process groups.
42. How to pass command line flags to a sqr report running through process scheduler?
Using override options in the process definition in the Process Scheduler in the People Tools.
43. What are On-break parameters?
ON-BREAK causes the specified action to perform in a tabular report when the value of a field changes . The default action prints the field only when its value changes (PRINT=CHANGE).Mainly used for Redundancy of Printing on a page.
44 .How does peoplesoft Process monitor knows that the process (Say sqr report) is at what stage such as initiated, in process, completed etc

From the Field Value of 'RUNSTATUSDESCR'field from 'PS_PMN_PRCSLIST' table.
45. How can u Debugging SQR programs?

We can Debug SQR using Debugging Commands such as
3. #IF DEBUGxxx
#END-IF
2. DISPLAY and
3. SHOW
46. How to refer a global variable in local procedure?
After special character (ex.#,&) we use underscore(_) after that variable name.
47. What is -Bnn flag?
This is used to specify the number of rows that are to be taken from Dbase to the Buffer because default the system takes 10 rows at a time.
48. What is -Tnn flag?
This is mainly used for testing purpose. We can restrict the system to generate only a specific number of pages instead of generating all pages for testing. This is used in Windows Environment.
49. What is -RS & -RT Flags?
RS is used to generate SPF file ie; stopping the program after the comilation. _RT is used to run the SPF file .This is also one kind of Performance increasing technique by saving the compilation time.

50. What are the sections in Sqr? Which one is necessary?
Setup, Heading, Footing, Program & Procedure Sections. Program section is the Mandatory section.
51. What is -debug command line flag?
This is used for Debugging in SQR.

52. How to place an corporate logo in sqr?
Using "Declare Image" command

53. what are the debugging commands in sqr?
Show & Display are debugging commands

54. what is the difference between them?
Show is used to display more than one variable at a time.
Display is used to display only one variable at a time.

AE Disable Restart


If you get an error message like this, you either need to restart the specific instance that abended, or remove the restart row from the table.
PeopleTools 8.46 – Application Engine Server
Copyright (c) 1988-2006 PeopleSoft, Inc.
All Rights Reserved
PSAESRV started service request at 14.19.05 2006-09-19
All Processing Suspended: Restart OPRID=PS, RUNID=AppEngName, PI=499 (108,503)
PSAESRV completed service request at 14.19.05 2006-09-19
Disable Restart:
You can disable the restart on the properties of the application engine, but that will not help when the Application Engine has already abended. Remember, the disable restart prevents the app engine from writing to the restart table when the program abends; it does not prevent it from checking the table to see if another instance is waiting to restart.
In other words, once an application has abended, disable restart will not allow you to rerun the program without restarting.
AERUNCONTROL Record:
The restart status is stored in the record AERUNCONTROL. If you receive the message requiring you to restart instead of rerun, then there is a row in this table for the program you are running and the run control that you are using.
Fields:
PROCESS_INSTANCE — instance that abended
OPRID — your user name
RUN_CNTL_ID — run control used when it abended
AE_APPLID — Application Engine program name
Fixing the Error:
To fix the error, you either have to delete the row from the table or restart the original process instance that abended.
SELECT * FROM PS_AERUNCONTROL WHERE AE_APPLID = ‘<App Engine Name>
Update:
Ray pointed out that PeopleSoft has provided an online way to fix the problem. You can do it from the page: PeopleTools > Application Engine > Manage Abends
Deleting the Row:
If you are the only one with an abended program, you can just truncate the whole table:
TRUNCATE TABLE PS_AERUNCONTROL
Or, if you want to just affect your program, you can do something more like this:
DELETE FROM PS_AERUNCONTROL WHERE OPIRD = ‘<username>‘ AND RUN_CNTL_ID = ‘<run control>

AE Q&A


1)     There are different types of variables in the Application Engine people code?
Local variable – these are available for the duration of the program in which they are declared.
Global / Component – These variables are available while the Application Engine program is running. They are saved at commits and checkpoints,
So they can be used for restarts. Component variables are same as Global incase of the AE.

2) What are the Different ways pass data between the steps?
1) State records – One row can be passed and can have many state records.
2) Component/Global People code variables
3) Temporary records – Multiple rows of data can be passed.

3) What is Prerequisite for the State record?
1) Should be either Derived work record Or SQL Table.
2) Name of the record must end in AET; this is how the system identifies the record as a state record.
3) PROCESS_INSTANCE must be a key.
4) Any data types except character or numeric must not be required fields.
Note: - No People code fires on an Application Engine state record.
No Validation of translate values or Prompt tables are done.

4) How to read the runctrl parameters in AE
1) SQL: - %Select (EMPLID) Select EMPLID from PS_AERUNCONTROL where PROCESS_INSTANCE = %PROCESS_INSTANCE and ORPID = %oprid
2) People code: - &SQL = “Select EMPLID from PS_AERUNCONTROL Where PROCESS_INSTACNE =” PS_TEST_AET.PROCESS_INSTANCE “and OPRID =” %oprid.
%PROCESS_INSTANCE or %Bind (PROCESS_INSTANCE) can be used.
%PROCESS_INSTANCE is more efficient and faster.

5) How do you execute Application Engine through Push Button?
1) CreateProcessRequest(),Schedule ()
2) CallAppEngine.
6) What is the syntax for CallAppEngine?
CallAppEngine (applid [, state record]);

7) What are the 3 trace parameters you can pass to your psae.exe?
- TRACE 
- TOOLSTRACESQL 
- TOOLSTRACEPC 
8) Which Trace option is the best place to start for general performance information?
- TRACE 384 – mostly used trace value.

9) What is the difference between a Trace value and Trace parameters?
A Trace parameter determines which type of trace is turned on.
A Trace parameter determines what type of data is recorded in your trace files (s).

10) What are the 3 common ways to pass a trace parameter and value to your program psae.exe?
Configuration manager, Process Definition, Command prompt.

11) What are the Different types of Application Engine?
Standard: Standard entry-point program.
Upgrade Only: Used by PeopleSoft Upgrade utilities only.
Import Only: Used by PeopleSoft Import utilities only
Daemon Only: Use for daemon type programs.
Transform Only: Support for XSLT Transform programs.

12) How do you program AE program for the restarts?
Program Level State Record
One of the state record needs to SQL Table, Since All Derived work record will be re-initializing on commit.
Program Properties
On the Advanced tab in the program properties dialog box, make sure that disable restart is not checked.
Configuration manager
In the configuration manager, sure that Disable restart is not selected on the process scheduler tab.
Section Level
Section type
The option for section type are prepare only and critical updates
If the section is preparing data i,e select data, Populating temporary tables, or updating temporary tables then the section should be prepare only.
If the section is updating the permanent application tables in the database, you should select critical update.
Step Level
Add an order by clause
%Select Field Select Field1 from PS_SOME_RECORD Where FIELD1 > %Bind (FIELD1) Order by FIELD1.
Step level
If the step is do select then we have select restartable.

Add a switch to the selected table
Delete processed rows.

The only restriction for batch runs occurs when you have restart enabled, and you are inside a Do Select that is of the Select/Fetch type (instead of "Re-select" or "Restartable"). with select/Fetch, all commits inside the loop are ignored, including the commit frequency if it's set.

13) What is Set Processing? 
Set Processing uses SQL to process groups, or sets, of rows at one time rather than processing each row individually. With row by row processing you following a repetitive loop that selects a row, determines if it meets a given criteria, if so, apply rule x to row Update row, commit. With set processing, you only select those rows that meet the filtering criteria and then run the rule once again all the affected rows.

14) Advantages of Set Processing?
Improved Performance: - Our internal testing has revealed that, in an overwhelming majority of cases, set processing performs significantly better than it is -by-row counterpart for “reasonable” batch processing volumes.

Minimized SQL Overhead: - It tends to use fewer Application Engine SQL statements that each processed more data than the statements executed in row-by-row processing.
Easy Maintenance: - if need to make a fix or add an enhancement to SQL, it’s just a matter of modifying the SQL or inserting the new “Chunk”.
Leveraging the RDBMS: - With Set – based processing, you take advantage of the SQL processing engine on the database rather than placing the processing burden and overhead on the application executable.

15) Testing and debugging application engine?
Application Engine Trace file-You can track the step execution of your application execution.
Application Engine Interactive Debugger – First click on the trace tab and turn off the statement timings. Select Profile -> Edit Profile-> Process Scheduler Tab -> Application section Select Debug check box.

(You can dynamically modify the state record run application engine step by step
People Code Debugger for the Application Engine.)
AE Trace files: - AE__.AET
Without the process instance: - AE__.AET

1) Order and flow of action types
1) Do When
2) Do While
3) Do Select
4) Peoplecode
5) SQL
6) Call Section
7) Message Log
8) XSLT
9) Do until

2) What is Prerequisite for the Temporary record?
1) Should have process Instance as key
2) Name should end with _TAO

3) Different types of Temporary tables
- Dedicated
- Un Dedicated (Shared)

4) Why Parallel Processing required?
Potential performance improvements by splitting the data to be processed into groups and simultaneously running multiple instance of your program to deal with different groups of data.
If you have a one program that uses a temporary table and is invoked multiple times, that single temporary table could be used concurrently in multiple executions of the code. This could create unpredictable results since the different instances of the code would be issuing delete, Inserts and/or updates unsynchronized with each other.
You could solve the problem by creating multiple temporary tables as a pool of tables. Each invocation of your program would have to allocate an unused temporary table,
mark it as ‘in use’ , use it and release it back to the pool when you through with it (for each Application Engine program you write).

5) How running AE program as Batch differs from running it online?
Application Engine programs are designed for two types of execution and each has its own pool of Temporary Tables
Online: 
Invoked by CallAppEngine from People code
Run quickly, synchronously, and at random times.
Potential for simultaneous executions
Uses the online Temporary Table pool.
Not restart able.
Psae.exe randomly assigns an instance number from the number range on your online temp tables.
If the instance number is in use psae.exe puts the program in Queue until the assigned instance becomes free.
Unlock on completion, on Crash free from Manage Abends.
Batch:
Invoked through the Process Scheduler.
Run for longer amounts of time, asynchronously, and at scheduled times.
Can be designed for parallel execution for performance.
Uses the Batch/Dedicated Temporary table.
Restart able.
It allocates instance number based on the availability on a record by record basis and psae.exe begins with the lowest instance numbers. If the properties are set continue - Base table is used with Process instance as key. 
If Re-starable – Locked across Restarts until completes successfully.
If not Re-startable on Program completion.

6) What are the important steps for implementing the parallel processing?
Define you Temporary Tables.
Set the Temporary Tables Online pool.
Assign Temporary Tables to your Application Engine program in it program.
Set Temporary Table Batch Pool – Instance count in the AE.
Build / Rebuild your Temporary Table record.
Code %Table Meta – SQL as reference to Temporary Tables in your Application Engine program, so that Application Engine can table references to the assigned Temporary Table instance dynamically at runtime.

7) What happens when all the instance of the temporary table are in use?
It behavior can control by AE developer. If the runtime options are set to continue “People Tools will insert rows into the base table using the PROCESS_INSTANCE as a key”. If temp table doesn’t contain PROCESS_INSTANCE as a key field in a Temporary table, you should change the Temp table runtime options to “Abort” in the appropriate Application Engine programs.

8) How can you divide the data to be processed by different instance of the program to perform parallel program?
Run control parameters passed to each instance of the AE program enable it to identify which input rows “belong” to it, and each program instance inserts the rows from the source table into its assigned temporary table instance using %Table.

9) What are the 3 common ways to pass a trace parameter and value to your program psae.exe?
Configuration manager, Process Definition, Command prompt.

10) What is the main purpose of the Access property in the Section?
Basically they have two option, public and private if section declared as public then it be access from other program.Private we cannot call from other program.

11) Which actions are mutually exclusive and why they are mutually exclusive?
Sql and callsection.

12) Error handling or Exception handling in Application Engine ?
Step properties:-
On Error:- 
Abort – Write message to message log and terminate.
Ignore - Write message to message log and continue.
Suppress – No message will be written, but program will continue.
People code Action: - On return options can used to handle run time errors.
Abort: - Exits immediately – Not recommended.
Break:- Exits the current step and section and control returns to the calling step.
Skip Step:- The program exits the current step, and continues processing at the next step in the section. If this is the last step in the section, the calling step resumes control of the processing.
SQL Action properties:-
No Rows:- When the Sql doesn’t return any rows, you can tell what application engine program should do.
Abort: - Program terminates
Section Break: - Application Engine exits the current section immediately, and control returns to the calling step.
Continue: - The program continues processing
Skip Step: - Application Engine exits the current step immediately and moves on to the next step. When using skip step keep the following in mind:
1) Application Engine ignores the commit for the current step at runtime
2) If the current step contains only one Action, only use skip step at by-pass the commit.
13) What are different types Do Select? 
1) Select/Fetch
2) Reselect
3) Restart able

Select/Fetch: -
Opens the cursor only at the first time and retrieve rows one at loop.
Commits inside the step (commits in the Called Section) are ignored if AE is Restart enabled.
Reselect: -
It opens the cursor and closes the cursor on each iteration of the loop.
It will reselect the same row of data. 
Logic in Actions of the step should be such that it will be changing the status of the rows in the table they do select is selecting.
Commits are not ignored and will be committed in a reselect loop when the restart is enabled.
Restart able: - similar to select/Fetch but it WILL COMMIT inside the loop thus allowing the checkpoint to the PS_AERUNCONTROL table.

14)What is the maximum limitation on temporary tabel instances in AE.
99

15) what is the difference between the %SELECT and %SELECTINIT meta sql functions.
Ans %select : if any values have not selected then previous value will be there
%selectinit : if any values have not selected then previous value will reinitilate to null

16) what is the difference between exit(0),exit(1) when we are using this functions in AE
Exit (1) causes immediate termination of a PeopleCode program. Use this parameter to rollback database changes.
Exit (0) caused immediate termination of a Peoplecode Program but don’t make rollback in the database.

Tuesday, February 5, 2013

Data Conversion Analysis

Data Conversion Analysis


During the upgrade, a large portion of the time is dealt in the Data Conversion area.  This is where PeopleSoft executes several Application Engines programs.
More data on how this is constructed will be added soon.

The below SQLs can be used to see how the Data Conversion is progressing.
SELECT RUN_STATUS_FLAG, COUNT(*) from PS_EOUF_DATACONV
WHERE UPG_PATH = 'HC89'
GROUP BY RUN_STATUS_FLAG
-- Value Translation  N = Not run, R = Running, Y = Already Run

This next SQL shows what is running.  By default, there could be up to three processes running at once.
SELECT A.AE_APPLID, AE_SECTION, A.* from PS_EOUF_RUNSTATUS A


This SQL shows all of the steps that will be run:
SELECT * from PS_EOUF_DATACONV
WHERE UPG_PATH = 'HC89'

Create a new Application Engine Program


Step 1: Create a new Application Engine Program
In Application Designer, click Ctrl + N or use the File > New menu option.  This will open the “New” dialog, and you can choose Application Engine program from the list.
You new program should look like this:
Step 2: Disable Restart
This step is very important.  If you don’t disable the restart and your program crashes, you will have to go through a few extra steps before you can rerun it.
First, click on the properties button while your program is in focus (you can also use the File > Definition Properties menu):
This should bring up the Properties dialog.  Then, go to the Advanced tab.  Check the “Disable Restart” option.
Step 3: Add an Action
First, click on the “Step 1″ step to select it.  I usually click anywhere in the gray, and this should turn it black.
Next, click on the Add Action button, or you can use the Insert > Action menu.
Finally, change the type from SQL to PeopleCode.
Step 4: Save the program
At this point, you need to save before you can add PeopleCode.  You can use Ctrl + S, click on the Save icon on the toolbar, or you can use the File > Save menu.
Step 5: Enter the PeopleCode
First, open the PeopleCode program by double clicking anywhere on the gray of the PeopleCode action.  Or, you can right click on it and choose the “View PeopleCode” option.
Next, you will probably want to open a file to show output from your PeopleCode testing.  You can use this PeopleCode:
Local File &log;
&log = GetFile("c:\temp\log.txt", "W", "A", %Filepath_Absolute);
Then, you can print to that file with the writeline() method.  For now, we will just print Hello, World.
&log.WriteLine("Hello, World!");
Finally, you will probably want to close your file:
&log.Close();
Here is what it all looks like:
Make sure to save once you make these changes.
Step 6: Run the Program
Again, after you have saved, go back to the main program window where you can see the Main section, Step 1, and your new PeopleCode action.  Then, click the run icon.
In the dialog, Check the Output log to file and uncheck Run Minimized.  The output log to file allows you to see what happened.  Otherwise, the window will close before you see what happened.  The run minimized isn’t a big deal, but if the program doesn’t run minimized you see it pop up and go away better.  When the program goes away, you know it is done running.
Finally, when it is done, check the output.  If you used the paths that I did your output should be in the c:\temp directory.  You should have two files.  The first, is the main output from the program.  Check this to make sure the program ran to success:

The second is the log that your PeopleCode created.  For now, it should just say, “Hello, World”.