Showing posts with label SQR. Show all posts
Showing posts with label SQR. Show all posts

Tuesday, 8 May 2012

How to build an efficient interface using AE or SQR


While building an Inbound/Outbound interface, most of the time we may be in dilemma whether to use Application Engine (AE) or SQR. Here are the tips to build an efficient interface using either AE or SQR.
If we use Application Engine, below points are to be taken into account
  • If the interface is INBOUND, its better to go for Application Engine
  • If the program fails, we can make use of Restart Control to restart the program from the position where it abends
  • PeopleSoft – Business Process related Validation will be taken care automatically when we go for AE/CI.
  • Parallel Processing can be easily achieved using AE. This can be done by using Temporary Tables and State Records.
  • Reusability of SQLs is very much easy when we go for AE.
  • Bulk Insertion of data and Set Processing of data can be easily done in an AE
  • COMMIT levels can be maintained either at SECTION or STEP levels
  • Generation of Reports using File Layout, Workflow related batch interface can be easily developed using an AE
  • XML related processing is quiet easy when we go for AE
  • When we go for Upgrade of the Current PS System, Retrofitting of AE is done by easily identifying the impacted objects.
If we are going to use SQR, below points can be taken into account to build an interface
  • Formatting of Reports is very much easy in SQR using Begin-Header, Begin-Footer and Begin-Setup commands.
  • If we are going to consider the Performance of the Interface Program, its better to go for SQR.
  • Better Performance can be achieved by using Load-Lookup Arrays and Dynamic SQL
  • Reusability of SQLs can be achieved by creating either generic Procedures or SQCs

Friday, 6 April 2012

SQR Interview Questions



1. 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
a.       Begin-select paragraph
b.      Begin-SQL paragraph
c.       Begin-document paragraph
2. Is it possible to increase the array size once defined?
No, it is not possible to increase the Array size once defined
3. 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
4. Can you Call a SQR from another SQR? How?
We can call one SQR program from another SQR program using Callsystem
But this is possible only in UNIX Operating system.
5. Briefly explain Most commonly used SQC’s in SQR programs?
Some of the most commonly used SQC’s are
STDAPI.SQC : This Is Process Scheduler Interface which is used to initiate and terminate some
                                      field values such as Process_instance & Run_cntl_id
SETENV.SQC : This is used to set the Default Environment based on the Database such Printer
                                      Type, Paper Size, Date formats Etc….
NUMBER.SQC :  This file contains generalized routines to format numbers.
DATETIME.SQC :  This file contains generalized routines to format dates and times.
RESET.SQC :  This is an important Footing SQC
6.  What are the commands used in file handling of SQR?
READ, WRITE, OPEN, CLOSE
7. 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 to avoid Redundancy of Printing on a page.
8. How can you Debug SQR programs?
We can Debug SQR using Debugging Commands such as
1. #IF  DEBUGxxx
    #END-IF
2. DISPLAY and
3. SHOW
9. What are diff b/w SQR and Appln Engine ?
                1. App engine is belongs to PeopleSoft whereas SQR is third party application.
                2. App engine are easy to maintain from support prospective as it's reside inside PeopleSoft (PS) applications. For SQR we need to separately take care as its file server objects and hence difficult to maintain & upgrade.
                3. App engine are very systematic to Develop and Debug. SQR are difficult debug.
                4. SQR is mainly used to create Reports. By App Engine we can not create reports.
                5. AE flow is easy to read and understand, while SQR is not that easy.
                6. SetProcessing the major difference between Application Engine and SQR. There is no such facility in SQR which  makes Application Engine a winner for data validations.                                                           
10.What are different types of variables in SQR?
1.       Column Variables
2.       List Variables
3.       System Variables
4.       Document Variables
5.       Substitution Variables
6.       User Defined Variables
11. Is there any read-only variable in SQR?
Column Variables & System Variables are Read-Only Variables.
12. How to pass Inputs for SQR program while running from windows?
Using ASK & INPUT Commands.
13. 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).
14. 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.
15. 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 , we can increase the Performance of the program by reducing the Compilation Time.
16. What is the SQC used to read data from translate table?
‘READXLAT.SQC’ is the SQC used to read data from Translate Table.
17. Which section is mandatory in an SQR program?
‘BEGIN-PROGRAM’ Section is Mandatory for an SQR program.
18. How will you display an image in SQR?
Using ‘DECLARE-IMAGE ,  END-DECLARE’ command.
19. 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….
20.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).
21. How many ways of performance tuning are there in SQR?
ü  Using LOADF-LOOKUP & LOOKUP
ü  Using ARRAYS
ü  Using MULTIPE REPORTS
ü  Using SQT Files
ü  Using –Bnn Command line Flag
ü  Running on BATCH SERVER
ü  Using Proper Programming Logic in SQR such as Using BREAK statement in EVALUATE Command.
ü  Proper SQL tuning such as using Sub queries instead of Joins.
22. 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
<Procedure name> [(report arguments)]
from Dual
End-select
To call from Begin-SQL, the syntax will be
Begin-SQL
<procedure-name>;;
End-SQL
23.Can you connect more than one database using one SQR?
Yes.
24. Program flow of SQR ?
When  SQR Program starts executing. There are two stages in the Program Flow.
1) Compile stage     2) Execution Stage
à Compile Stage :
All the Preprocessor directives are compiled ( which starts with #include).
Ex: All the SQC are run.
Check for the syntax errors for the conditions.
Ex: if, for loop, while loop are properly ended with the respective syntax.
Allocates memory structure , if you are using the Arrays and load look up .
à Execution stage:
Starts interpreting the code line by line.
Check for the begin -program body.
Begin -heading.
Begin- footer.
setup sectionàheading section àfooting section àprogram section àprocedure section

25. 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
     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.
c. Giving the permission to the user by giving process groups.
26. 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.
27. what is hierarchy in Arrays in SQR ? 
There are 3 steps
 First we have to  Initiate Array  & then  Process Array  and  Print Array .
28. 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.
29. How can you send emails using SQR ?
using  call system  command.
30. How to refer a global variable in local procedure?
After special character (ex.#,&) we use underscore(_) before that variable name.
31. 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.
32. 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.
33. 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.
34. What is -debug command line flag?
This is used for Debugging in SQR.
35. How to place an corporate logo in SQR?
Using “Declare Image” command
36. what are the debugging commands in SQR?
Show & Display are debugging commands
37.  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.




Component Interface Interview Questions


1. What is Component Interface meant for?
It enables synchronous access to a PeopleSoft component from another application (third party application like Java,C++,COM etc) including all business rules and data.
2.What are the main elements in the Component Interface ?
Main elements of Component Interface:
ü  Component Interface name
ü  Keys
ü  Properties and collections
ü  Methods
3.What are the standard properties when a Component Interface is created?
Standard properties of CI are:
ü  Interactive mode
ü  GetHistoryItem
ü  EditHistoryItem
4. Can we map more than one component at a time from the CI ?
No, A Component Interface can be mapped to only one component, but one component can be mapped to multiple CI’s.
5. Explain what  are the various steps that describes the PeopleCode logic while implementing a Component Interface?
1.       Establish a user session
2.       Get the Component Interface
3.       Populate the Create Keys
4.       CREATE an Instance of the CI
5.       Populate the required fields
6.       Save the CI .
6.What is method? What are the different types of method?
A method is an object that performs a very specific function on a CI  at runtime.
                Types Methods are Standard methods and User-defined methods
Standard methods: - Automatically generated upon the creation of a new component Interface in Application
7. Which KEYS are mapped as find keys for a Component Interface?
                Search key and alternate search key.
8. How do you login in correction mode in the Component Interface?
Get History Items and Edit History items property to should be set to true.
9. If you are PS developer then in what scenarios Component Interface will have advantages over component?
A component exposes your pages to PeopleSoft only. Moreover it helps us to define common properties for a set of related pages.
A Component Interface is a set of application programming interfaces (APIs) that you can use to access and modify PeopleSoft database information programmatically.
PeopleSoft Component Interfaces expose a PeopleSoft component (a set of pages grouped for a business purpose) for synchronous access from another application (PeopleCode, Java, C/C++, or Component Object Model [COM]).
10. What happens when a Component Interface is created on component that has add Action enabled?
Create method and create keys are created. The create method will not be present if the Add mode for the Component is not enabled.
11. Can we create get and find keys manually ?
No, These keys are created based on the search record definition for the underlying component.