Translate

Thursday, 11 July 2013

sqr interview questions peoplesoft




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
                                Begin-select paragraph.
                                Begin-SQL paragraph.
                                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 Call.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
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.
       5.   RESET.sqc :  This is an important Footing SQc
      
6.  What are the commands used in file handling of sqr?
        Using File Handling we can Import.
 Steps are
1.      Opening a File Using ‘OPEN FOR-READING’ command.
2.       Reading Data From File Using ‘READ’ command.
3.      Writing Data into Table Using ‘BEGIN-SQL’ paragraph & ‘INSERT’ command


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 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  SQC                           4.We can call one SQC from another SQC or another SQR                                                                

10.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.
And  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?
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.

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.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.
    Added.                                                                       gives a error if  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
                                                                                       table
5. have  Length & Data type.                                   5.  don’t have Length & Data type.
6.We cannot directly print from Array.                    6. We can directly print from Load-Lookup.

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 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.
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 u Debugging SQR programs?
We can Debug SQR using Debugging Commands such as
1. #IF DEBUGxxx    #END-IF
2. DISPLAY  and
3. SHOW

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 these?
Show is used to display more than one variable at a time.
Display is used to display only one variable at a time.
38.

Tuesday, 30 April 2013

how to generate multiple reports using xmlp

  • burst by option helps in generating multiple reports in xmlp
  • if u r report in burst mode we can't see output in query report viewer, we can see only in query report scheduler    
  • we can see multiple report  output in report manager not in process monitor.

Thursday, 18 April 2013

Delivered Page to Search Component Navigation.

There was several solutions to find the navigation path for component and page. There were several SQL statements for different databases. Finally Oracle as developed page this purpose.
  • we can find using this sql code 
SELECT a.PORTAL_NAME,     
f.PORTAL_LABEL AS parent5_folder,                  
e.PORTAL_LABEL AS parent4_folder,
d.PORTAL_LABEL AS parent3_folder,
c.PORTAL_LABEL AS parent2_folder,   
b.PORTAL_LABEL AS parent_folder,
a.PORTAL_LABEL AS component           
FROM PSPRSMDEFN a
LEFT JOIN PSPRSMDEFN  b ON b.PORTAL_NAME = a.PORTAL_NAME
AND b.PORTAL_OBJNAME = a.PORTAL_PRNTOBJNAME
LEFT JOIN PSPRSMDEFN  c ON c.PORTAL_NAME = b.PORTAL_NAME
AND c.PORTAL_OBJNAME  = b.PORTAL_PRNTOBJNAME
LEFT JOIN PSPRSMDEFN  d ON d.PORTAL_NAME = c.PORTAL_NAME
AND d.PORTAL_OBJNAME  = c.PORTAL_PRNTOBJNAME
LEFT JOIN PSPRSMDEFN  e ON e.PORTAL_NAME = d.PORTAL_NAME
AND e.PORTAL_OBJNAME  = d.PORTAL_PRNTOBJNAME
LEFT JOIN PSPRSMDEFN  f ON f.PORTAL_NAME = e.PORTAL_NAME
AND f.PORTAL_OBJNAME = e.PORTAL_PRNTOBJNAME
WHERE a.PORTAL_REFTYPE = 'C'
AND a.PORTAL_URI_SEG2 = 'Type delivered component name'

  • In the latest Ptools 8.50 and Application 9.1 application search is possible from two navigations.

1) Main Menu > Enterprise Components > Find Object Navigation
2) Setup HRMS > System Administration > Utilites > Portal Navigation Path

Search is possible with name of Component,Page,Secondary Page and Content Reference.

Search works fine with hidden components as well.


Tuesday, 2 April 2013

xml publisher subtempletes and logo

  • create a data source using ex: ps query 
  • get delivered sub template  from content library  add u r company logo and address to that and save it with u r own name
  • create u r own main template  add this code
    • Importing Sub-Templates to main template
      To import a sub-template file that is stored in the Content Library, place the following syntax at the top of the primary template file:
      <?import:psxmlp://sub-template_NAME?>
      where sub-template_NAME is the registered sub-template ID in the Content Library, for example:
      <?import:psxmlp://STDHEADER?>. This syntax must be in Normal text.
    • Calling Sub-Templates
      Place the following syntax in the primary template file in the location where the desired text or XSL
      instructions from the sub-template file should appear:
      <?call-template:peoplesoft?>
      In the preceding sample code peoplesoft is the name of the component that you want to use in the subtemplate file  EX: <?call-template:portrait?>
  • then see o/p in report viewer 

Wednesday, 20 March 2013

Multiple reports in sqr with one real time scenario

Requirement :   print two reports
  • The first report will list all employees who currently participate in any health benefit plan along with their plan type and coverage codes. In addition, the report will indicate which employees had their dependent’s coverage terminated.
  •  The second report will list only those employees and their dependents who had their benefits coverage terminated within the reporting period.
!**********************************************
.SQR
!A multiple report program
!**********************************************
!Set report column widths
#Define col_emplid 11 !Employee ID
#Define col_empl_name 15 !Employee Name
#Define col_plan_type 5 !Plan Type
#Define col_cov_cd 8 !Coverage Code
#Define col_cov_drop_flag 5 !Dependent Coverage Termination
#Define col_effdt 12 !Effective Date
#Define col_dep_id 6 !Dependent Beneficiary ID
#Define col_dep_name 15 !Dependent Name
#Define col_sep 1 !Column Separator
!***********************
Begin-Setup
!***********************
Declare-Layout EE_Data
Left-Margin=1
End-Declare
Declare-Layout Term_Dependents
Orientation=Landscape
Left-Margin=0.3
End-Declare
Declare-Report EE_Data
Layout=EE_Data
End-Declare
Declare-Report Term_Dependents
Layout=Term_Dependents
End-Declare
End-Setup
!**********************************
Begin-Program
!**********************************
Do Process_Main
End-Program
!**********************************
Begin-Heading 4 For-Reports=(EE_Data)
!**********************************
Print 'List of Employees by Plan Type' (1) Center
Print 'Page' (,+9)
Print #page-count (,+1) edit 999
Print 'EMPLID' (+1,1,{col_emplid})
Print 'Name ' (0,+{col_sep},{col_empl_name})
Print 'Plan ' (0,+{col_sep},{col_plan_type})
Print 'Effdt' (0,+{col_sep},{col_Effdt})
Print 'Coverg' (0,+{col_sep},{col_cov_cd})
Print 'Dep. ' (0,+{col_sep},{col_cov_drop_flag})
Print ' ' (+1,1,{col_emplid})
Print ' ' (0,+{col_sep},{col_empl_name})
Print 'Type ' (0,+{col_sep},{col_plan_type})
Print ' ' (0,+{col_sep},{col_Effdt})
Print 'Code ' (0,+{col_sep},{col_cov_cd})
Print 'Term ' (0,+{col_sep},{col_cov_drop_flag})
Print '-' (+1,1,60) Fill
End-Heading
!********************************************
Begin-Heading 4 For-Reports=(Term_Dependents)
!********************************************
Print 'List of Terminated Dependents' (1) Center
Print 'Page' (,+15)
Print #page-count (,+1) edit 999
Print 'EMPLID' (+2,1,{col_emplid})
Print 'Name ' (0,+{col_sep},{col_empl_name})
Print 'Plan Type' (0,+{col_sep},{col_plan_type})
Print 'Effdt' (0,+{col_sep},{col_Effdt})
Print 'Dep ID ' (0,+{col_sep},{col_dep_id})
Print 'Dep Name' (0,+{col_sep},{col_dep_name})
Print '-' (+1,1,65) Fill
End-Heading
!***************************************
Begin-Procedure Process_Main
!***************************************
!Select and print all Employees
!who are currently covered by any Health Benefits
!and who have Family, or Empl+1 Coverage
Begin-Select
A.Emplid
A.Plan_Type
A.Effdt
A.Covrg_Cd
B.Name
Do Check_Dep_Termination
If $TERM ='N'
Let $TERM = ' '
End-If
Do Print_EE_Data
From Health_Benefit A, Personal_Data B
Where A.Effdt =(Select Max(Effdt) From Health_Benefit
Where Emplid = A.Emplid
And Plan_Type = A.Plan_Type
And Effdt <= Sysdate)
And A.Coverage_Elect Not In ('T','W')
And A.Emplid = B.Emplid
Order By A.Emplid, A.Plan_Type
End-Select
End-Procedure
!***************************************************
Begin-Procedure Check_Dep_Termination
!***************************************************
! For each row retrieved in Step 1, compare between the previous
! maximum effective dated record and the current effective dated
! HEALTH_DEPENDNT row to determine a dependent that is no longer
! covered

! If dropped dependents are found, print the record to a
! separate report

Move 'N' to $TERM
Begin-Select
C.Emplid
C.Plan_Type
C.Effdt
D.Dependent_Benef
Move 'Y' to $TERM
Do Print-Terminated-Dependents
Show 'Dep Term found=' &D.Dependent_Benef ' for Employee '
&A.Emplid
From Health_Benefit C,
Health_Dependnt D
Where C.Emplid = &A.Emplid
And C.Plan_Type = &A.Plan_Type
And C.Emplid = D.Emplid
And C.Plan_Type = D.Plan_Type
And C.Effdt = D.Effdt
And C.Effdt = (Select MAX(E.Effdt)
From Health_Benefit E
Where C.Emplid = E.Emplid
And C.Plan_Type = E.Plan_Type
And E.Effdt < &A.Effdt)
And D.Dependent_Benef Not In
(Select F.Dependent_Benef
From Health_Dependnt F
Where C.Emplid = F.Emplid
And C.Plan_Type = F.Plan_Type
And F.Effdt = &A.EFFDT)
End-Select
End-Procedure
!***********************************
Begin-Procedure Print_EE_Data
!***********************************
Use-Report EE_Data
Let $EmplID=&A.Emplid
Let $Date_Str= Datetostr(&A.Effdt,'mm/dd/yyyy')
Print &A.Emplid (+1,1,{col_emplid}) On-Break Print=Change/Top-Page
Print &B.Name (0,+{col_sep},{col_empl_name}) On-Break
Print=Change/Top-Page
Print &A.Plan_Type(0,+{col_sep},{col_plan_type})
Print $Date_Str (0,+{col_sep},{col_effdt})
Print &A.Covrg_Cd(0,+{col_sep},{col_cov_cd})
Print $Term (0,+{col_sep},{col_cov_drop_flag})
Add 1 to #ee_rcds
End-Procedure
!******************************************
Begin-Procedure Print-Terminated-Dependents
!******************************************
Use-Report Term_Dependents
Let $EmplID=&A.Emplid
Do Get_Dependent_Name
Let $Date_Str= Datetostr(&A.Effdt,'mm/dd/yyyy')
Print &A.Emplid (+1,1,{col_emplid})
On-Break Print=Change/Top-Page
Print &B.Name (0,+{col_sep},{col_empl_name})
On-Break Print=Change/Top-Page
Print &A.Plan_Type(0,+{col_sep},{col_plan_type})
Print $Date_Str (0,+{col_sep},{col_effdt})
Print &D.Dependent_Benef(0,+{col_sep},{col_dep_id})
Print $DEP_NAME (0,+{col_sep},{col_dep_name})
Add 1 to #Dep_Rcds
End-Procedure
!************************************************
Begin-Procedure Get_Dependent_Name
!************************************************
Let $Dep_Name=' '
Begin-Select
Name
Move &Name to $Dep_Name
From Dependent_Benef
Where EMPLID=&A.Emplid
And Dependent_Benef=&D.Dependent_Benef
End-Select
End-Procedure
!************************** End of Report ***************************

Wednesday, 6 March 2013

SETID BUSSINESSUNIT IN SEARCH PAGE

create record any name insert fields from BU_DEPT_VW ,set u r record as search record will registering component.

Monday, 4 March 2013

Delevered SQR's

 Befits module :
BEN001:  health plan participation 
Navigation :benefits --> reports --->participation ---> health plan participation


BEN003: quarterly benefit contribution register
Navigation  :benefits --> reports --->contribution and deduction-->benefit contribution register

BEN 002 : life insurance participants 
Navigation :benefits --> reports --->participation ---> life insurance participation
 

BEN 733 :BASE BENEFITS AUDIT REPORT
Navigation :benefits --> reports --->Audits-->Base Benefits consistency audit
the report contain following details 

Employees Less Than 16 Years Old
People With Unusual Dependents Signed Up For Coverage
Employee and Spouse (or Other Dependent) Both Electing Health Benefits
Employees With Over-Age Dependent Coverage
Employees (Married) who do not have Spouses on file
Employees (Non-Married) who have Spouses on file
Employees whose Spouse/ExSpouse has wrong Marital Status
Employees whose Spouse has wrong gender