APPLICATION DESIGNER

:
What are the 8 Development Steps? 8 steps in Developments steps: Design the Application, Create Field Definition , Create Record Build the Record, Design the Page, Create Component, Register the Component, Test the Application
Translate Table? A translate table is a prompt table that serves as data dictionary to store values for fields that don¶t need individual prompt tables of their own. Limitations of Translate table? 3. Field values should be small (static). 1. Field type should be character 2. Minimum Field length should be 1 to 4 characters. What is a prompt table? Prompt tables are the most common methods for validating data entry in ps applications.
This is like application data table the only difference is that it stores values that other tables can validate against. Prompt table is a control table. (Country table and Company table)

How many table edits are there in Record field properties?
1. Prompt Table With Edit 2. Prompt Table No Edit 3. Translate Table 4. Yes/No Table Edit Prompt Table No Edit: Provides List of Suggested values, which users cannot edit.
Prompt Table With Edit: Users can edit the contents of the field against the values that are maintained in the specified prompt Table.

Translate Table Edit: Which is nothing but a translate table created by developer. Yes/No Table : I need some situations we want the user to enter only Boolean values like yes or no, true or false in this situation we will use yes no table. What is a record? A record definition is a definition of what your underlying SQL database tables will look like,and how they will process data.

What are the 3 build options available when building a table from a record? Build script file: which generates a sql script that can be run against the desired database to build the table.
Execute SQL: which builds the table in the database. Execute and build script: which both Build the table and generates a SQL script. How many types of tables are there? Define them? SQL Table: A physical SQL Table present in the database, this is the default. SQL View: Not a physical SQL Table but corresponds to a view written in SQL referring one or more fields from different tables. This gives a
filtered view of information stored in tables. Stored in the database as a view. (Query view is system generated and SQL views are created by developer) whenever you modify a record you need to take care: check if any views are dependent on this record.

Dynamic view: A record definition that can be used like a view in pages and People Code but is not stored as a SQL view in the database. Dynamic views provide superior performance. Query View: using the PeopleSoft Query we don t need to write a query it will automatically generate by dragging and dropping. This is a two tier tool and runs through application designer and produces SQL dependent upon the host RDBMS. Derived/Work: We can use it to calculations. It is not an object, and also we can use it as a funclib. A temporary workspace to use during online page processing. A derived or work record is not stored in the database, so no need to build it.

A derived / work field may be used to store and display a calculated value on a panel or to pass a value from one People Code program to another.
Sub Record: Group of fields used in multiple records like companies having address data of employees. If you have to use the same fields in different record definitions, then we will store all those fields in a subrecord and add this subrecord as a field to the record definitions. Stored in the database. Temporary Table: we will do all the manipulations on the data present in the temporary table. Increases the performance, as it is not stored in the database. Used mainly for the AE batch processes.

Dynamic view? Where we can use dynamic View? It can be used like a view in pages and people code but not stored in
database as a sql view, instead the system uses the view text as a base for the sql select that is performed at runtime. Dynamic views

shows superior performance in some situations such as search records and people code selects.

Difference between Query Views & Dynamic Views? 1. Query Views are designed using Query Manager Tool where as we write SQL in Dynamic Views. 2. Query View is Built and Exists in the Database where as Dynamic View can t be build so it doesn t exists in Database. Diff: SQL View and Dynamic View?
SQL views are written against the RDBMS catalog tables. Dynamic view is declared only to p.tools and not to the system catalog.

SQL views r not recommended for performance tuning as they run against the database. Dynamic views improve performance. SQL views reside in the Db, dynamic views are not. Difference b/n primary record and the search record?

All fields in a scroll area or grid must be associated with one (and only one) record, which is the primary record for that level. The search record builds the search page for a component and populates all fields at level 0. Subrecord? A SubRecord by definition allows you to add a group of fields that are commonly used in multiple record definitions. A SubRecord must be defined before it can be entered into a record definition. Insert - SubRecord What are Sub panels? If you have groups of controls, such as address controls, that you use on multiple panel definitions, you can save it as a subpanel. And insert this sub panel wherever you want.

What are Secondary panels? Secondary panels are used to gather or display information related to the objects that
appear in a primary panel. A secondary panel can be called from the primary panel and used to enter
or display additional data without cluttering your primary panel.

RowSet is data structure representing the hierarchical data, RowSet consists of set of rows, where Each Row consists of set of records and child RowSets. Used this Rowset object to retrieve the data from component buffer.
Take any page PRESS Ctl J Standard page: It is the graphical interface between users and database. The important data is displayed in the standard page. We can place secondary as well as a subpage in standard page. Secondary Page: Page that will open on users request but remains as a secondary to the primary page display. We can open it through standard page only. The data within secondary page is at the same level or below the level of the page control that launches the secondary page. Subpage: subpage controls are used to provide standard look for the commonly used fields. A sub page is referenced as a page control on multiple standard pages.

Difference b/n standard, secondary and subpage?

How to invoke the secondary panel? There are 2 ways: yInsert a PB control type of Secondary Panel. This automatically invokes the secondary panel when the user presses the PB. yInsert a secondary panel control. This is invisible at run time. When you use a secondary panel control, u must also insert a
command PB on the panel and call the DO MODAL Pcode function from the PB's FieldChange event in order to invoke the

Difference between subpage and sub record All the fields in a subpage must be associated with fields of a sub record in the specified record definition. Subrecord contains all related fields, whereas subpage contains fields from sub record. What is occur level and occur count? Occurs Level: Occurs level determines the level of the object that we inserted. By using this we can set levels for example
secondary panel.

after inserting a level based control in level 2 if you want to change the level based control to level 1,U can change the occurs level.

Occur Count: Occur Count determines how many rows should be displayed. For ex if you want the scroll to display only 5 rows then we will give occurs count to 5. What is a Related Display field and Display Control field?
A related display field is for display purposes only - it always references a row that's not being updated from the current panel. The display control when you select Related Display field, you need to relate it to the appropriate control. A list of all the controls on the panel marked as display control fields in the Related control field box. Select the control field to Which this particular related display is related. Scroll Area? SA Is a Page Control which contains Child Records¶-Fields which is used to maintain the ParentChild Relationship between Tables. We can place any number of scroll areas on a page.

What are Level Based Controls and their Difference? Level Based controls are Scroll Area, Grid and Scroll Bar. Scroll areas have their page fields arranged by the developer. Page fields in a gird always appear in a single row. In grid we can view no of rows by giving occurrences. Scroll areas provide a row separator when you select multiple occurrences of data. We can view multiple rows in a grid while in a scroll area you can retrieve only one row at a time. One can have nested scroll areas but not grids. You can insert grid in a scroll area but not scroll in a grid. What is Parent Child Relationship? To maintain parent child relationship if the parent table contains one key field the child table should contain the same key field and one additional key.

Conditions are: 3) we can not go for more than three levels of parent/child relationships. 1) The child record should have all the key fields of parent record and at least one more key field other than the key fields of parent record. 2) We should mention the parent record in the record properties of child record. Advantages are: 1) To have referential integrity. 2) No need to enter information again and again
What is the difference between scroll area and Grid? I used in Employee and Employee dependent details Scroll areas single row of data will be displayed whereas in grid multiple rows of data will be available.
Yes I used scrollAreas, 4 Levels of scroll areas are in Peoplesoft, and they are level0, level 1, level 2, level 3, level 4

How many levels can we have on a page? Page allows Nested levels up to 3 levels.

Component Buffer? Area in memory, which stores data for the currently active component. Whenever you open a component the entire data for that component is retrieved upfront and stored in the application server. Component buffer is a temporary buffer allocation. Component processor? It is a peopletool runtime engine that controls the processing of the application. Data buffer? Data buffer contains multiple components of data. Difference between component buffer and data buffer? Component buffer contains active component data i.e. level 0 data. Data buffer contains multiple components of data.

What data comes into Component Buffer?
Primary record data, related display fields, translate values and derived work records. If you keep key and alternate search key on 0 level then only 2 values will appear in Component Buffer the other field values will not available. In Component Buffer if you want to see the other field values then place a non-key field on 0 level and make it invisible. Every level will have its own primary record. A level 0 primary record and a search record can be different but the key field values should match.

What is registering a Component? We will add the component to a Menu and give permissions and security.
What is Business Unit? What are the major functions? It performs 2major functions : 1),2).. A business unit is a way of tracking specific business information for reporting and other roll-up data collection.

1) It allows you to maintain a tree structure to facilitate customer-specific roll-up reporting. 2) It allows you to distribute and administer certain control tables like the department table. This is extremely important for large or multinational companies. What is Setid? Keys to linking business units to record control groups. It is the key on all control tables in TableSet
sharing every row in a control table includes a setid as its key.

SetIDs partition the data into groups or sets of data that are appropriate for each Business Unit. What is Table Sharing? It is a method of filtering prompt data so that only appropriate values are available for data entry.
With TableSet sharing, a single table can offer different values based on underlying business rules. Table set Sharing is organized around these basic elements:Business Units and transaction tables, SetIDs and control tables, Business rules.

Record group consists of records with similar functionality. To setup a record in record group we should enter a set control field value in
record properties

Difference b/n a Business Unit and a Set Id? It·s a way of organizing your data in the system. A BU is a way of tracking and reporting specific business information for reporting and other roll up data collection. It does not have to be a legal entity for HR. It·s a way of organizing your organization.
A SetID is a link to Table Set Sharing. Table set sharing simply consists of assigning specific SetIDs to specific
record groups for individual Business Units to restrict the view of rows of data within Control Tables.

Joins:

Inner join: Matches key fields & gets the common part in the case of Inner join. LOJ (Left-outer join): Matches key fields, and gets common data as well as additional data in left table. ROJ: Matches key fields, and gets common data as well as additional data in rightt table.(we cant perform this in ps) Self join(SJ): Joining same table is called self join.
SUB Query: the output of one SELECT statement acts as an InPut for another SELECT statements.

About Views: A view is a database object that is a logical representation of a table. It is derived from a table but has no storage of its own and often may be used in the same manner as a table. Creating a view:
Create view INVASION AS Select WEATHER .City, Condition, Temperature, Latitude, NorthSouth, longitude, EastWest From Weather, location, Where WEATHER.City = LOCATION.City;
Search views are used for three main reasons.

1. Adding criteria to the search dialogue page 2. Providing row level security. 3. Implementing search page processing. Advantages of Using Search Views instead of Search Table: As the search view is created with selected fields there will not be much stress on app server and there by improves the performance. Search View also gives additional search criteria.
In PIA (?) End users do not have any peoplesoft specific software installed on their machines, they use Internet browser to connect web server, which interacts with application server.

What are the 3- Actions that can be attached to Menu? -Component -Separator -PeopleCode
Deffered and Interactive Processing In Interactive mode for every cursor action there will be a trip to the server. In deferred processing mode, trips to the server are reduced. In Interactive whenever a user exits a field there will be a trip to the server. In Differed processing until a user performs an action, which requires a trip to the server there wont be any trips to the application server. In how many places we can set Differed processing? Field,Record,Page,Component

EFFDT) .EMPLID FROM PS_JOB A Which is used to maintain search record is determined at the component level. and future information in tables.EMPLID AND A. Past date . current and future information. .Represents the date that the specific data change goes into effect. date will be same so to differentiate from other we need a sequence of order so it shows the order of occurrence. as the system constantly compares the effective dates to information stored in other tables.EMPLID = A_ES. Effective sequence? Whenever we want to enter more than one transaction on the same day for an Employee like promotion and salary hike we will use effective sequence. from that future date onwards this dept is going to be inactivated. current.EFFSEQ = (SELECT MAX(A_ES. Effective date? Date on which a table row becomes effective.Above 30 days of current date is called History Date.EFFDT = A_ES. The SELECT A.The Effective Date: . Effseq number starts with 0 Use of EffSequence.EMPL_RCD AND A.EMPLID AND A.EMPL_RCD = A_ED.Works as a cross-reference.Allows us to maintain history. different row for the same key value & same Effective Date. WHERE A.EFFDT) FROM PS_JOB A_ED AND A. Pages or panels and batch processes that use the information use the current row. after that whenever we click the link prompt button of dept id field we can see only active departments.EFFSEQ) FROM PS_JOB A_ES WHERE A. Ex: if you want to close out a ledger on June 30. . This ensures that data you select from PeopleSoft is valid as of the desired effective date.EFFDT = (SELECT MAX(A_ED. This date also determines when you can view and change the information. History and Future.EMPL_RCD AND A_ED. There are 3 types of effective dates: Current. Effective status? EFF_STATUS usually accompanies EFFDT.EFFDT <= GETDATE()) AND A. the date that an action begins.EMPLID = A_ED. Ex: in Department table suppose we inactivated one dept from so and so future effdt.EMPL_RCD = A_ES. same day different action will be performed so Effetivedate . .Within 30 days of current date is called past date. History date .Enables us to maintain a complete chronological history of all records. the EFFDT for the ledger closing would be July 1. Effective date enables us to keep historical.EMPLID = '12345' WHERE A.

ATTRIBUTES of the Component Interface? and different keys in CI? 1. We cannot change the create keys. Cancel.Item(&i). 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. CI name. Properties: Properties are individual fields in component for CI. We cannot change the get keys. we will give a name to CI to access.. End-Function. CI s.Count. Save. Whenever we create a CI.Type. Get keys are nothing but search key of the component search record.PSMessages. GetKeyInfoCollection: Returns a set of items that describes the get keys FindKeyInfoCollection: Returns a set of items that describes the find keys PropertyInfoCollection: Returns a set of items that describes properties.Item (&i). (Standard properties exists for every CI) ***Properties are 2 types Standard properties. Collections are referred as scrolls(level based controls will be having a primary rec) in the component for C. Why should we write in save post change only. cancel. 3. Create key are generated only when the CMPT is in Add action only.User-defined methods are those that you can create to meet the requirements of an individual CI. and find keys). 2. Fundamental elements in the CI architecture: components.modes will be used. dcom etc). why not in other event? Because CI object data will not be in component buffer and student information component data will not be in component buffer so we are updating/inserting the data in the data base not in the component buffer tables. Can we map more than one component at a time from the CI? NO Can we create the get keys and find keys manually? No. Function CheckErrorCodes() &PSMessages = &Session. Methods? How many Methods are there? A method is an object that performs a very specific function on a component 2 types of methods are there: Standard methods and user-defined methods. c++.) Standard methods: . We can create user-defined methods after creating a CI.Keys (get keys. c. Create methods return false.). There r Apart from the Standard methods there are Standard methods available for the use with any collection. Types of properties can include the CI? Standard properties User-Defined Properties What are the standard properties? Interactive Mode GetHistoryItems EditHistoryItems. Find keys are based on search key and alternate search keys of the search record. CI API. Error text and Error type can be printed in the log message for any other action in to the log message.Automatically generated upon the creation of a new CI in Application. CreateKeyInfoCollection: Returns a set of items that describes the create keys.Update display all . created based on the search record definition for the underlying component. Methods (Save. Create. We can remove find keys if we don t want to use Create keys are based on the add search record keys (add mode) and generated automatically for the component interface.4. Get History Items alone: . java. User defined properties Createkeyinfocollection Developer Can Further Control The Exposed Getkeyinfocollection field properties. yEdit 3) How do you provide security for the component interface? yOpen the Permission list yOn the Component Interface tab yAdd row and select the newly created Component Interface the permissions to give permission for the standard methods yGet.(CI) Component Interface is used to access Cmpt from external clients (Third Party Applications) including all business rules and data without going through the ps client. User-Defined methods: .. To expose cmpt (methods and properties) to the external software (ex: vb. com.Interface. create keys. The event of a CI is methods (like On Execute for AE. &ErrorType = &PSMessages. . Catching Error Message in the CI? Or Use of PSMessages in the CI? This function needs to be called when ever methods like Find. interface at run-time.Text. Can we create the user-defined methods? Yes. Findkeyinfocollection Property Info collection GetHistoryItems (Update/Display mode or Correction mode) EditHistory Items InteractiveMode. &ErrorCount = &PSMessages. Properties and collections (fields and records). find. Save. End-For. For &i = 1 To &ErrorCount &ErrorText = &PSMessages.

Create methods return false. &COLL_JOB_JRItm.Text. How can a component have more than one search record? Give a situation. &COLL_JOBCol = &CI_JOB_DATA. Java. &ErrorCount = &PSMessages.KEYPROP_EFFDT =.Item(&i). &Session = GetSession().Count &COLL_JOB_JRItm = &COLL_JOB_JRCol.COLL_JOB_JR.Count &COLL_JOBItm = &COLL_JOBCol. It does not change the component definition. Save the CI 2) If you are PS developer then In what scenarios Component Interface will have advantages over component? A component exposes your pages to peoplesoft only.Item (&i). Save. Traversing « the Collections in the CI? COLL_JOB ± Collection Coll_JOBItm ± Row in the collection. Error text and Error type can be printed in the log message for any other action in to the log message.pulate the required fields 6. For &i = 1 To &ErrorCount &ErrorText = &PSMessages.Create () Then Else Populate other fields End-if. &ErrorType = &PSMessages. Populate the other fields If not &CI. For &i = 1 to &COLL_JOBCol.The following are various steps that describes the peoplecode logic while implementing a Component Interface 1. End-Function.Save () Then Else End-if. Function CheckErrorCodes() &PSMessages = &Session.PSMessages. 4) What the steps that you need to do in people code to invoke Component Interface? yEstablish a user section yGet the component interface definition yPopulate the create keys yCreate an instance of the component interface yPopulate the required fields ySave the CI.Type. For &J = 1 to &COLL_JOB_JRCol. How do you test Component Interface? yUsing the CI tester yGive values in the tester for options yGet Existing.INTERFACE_NAME) &CI.KEY_FILED_NAME = µNEW¶ If not &CI. and occurs only when the component is opened from the menu item in which the override is set.GetcompIntfc(CompIntfc. Moreover it helps us to define common properties for a set of related pages. The component override is temporary. PeopleSoft Component Interfaces expose a PeopleSoft component (a set of pages grouped for a business purpose) for synchronous access from another application (PeopleCode. You might want to reuse the same component multiple times with different search records. . &CI = &Session. C/C++. &COLL_JOB_JRCol = &COLL_JOBItm.COLL_JOB. Create new.pulate the Create Keys 4.Establish a user session 2.Item (&j). You can accomplish this by overriding the component search record at runtime when the component is opened from a menu item without creating separate copies of the component. A component interface is a set of application programming interfaces (APIs) that you can use to access and modify PeopleSoft database information programmatically.Item(&i).Create an Instance of the CI 5. End-For.Count. or Component Object Model [COM]). Find and perform the operation from the CI Tester Catching error message in the CI? Or Use of PSMessages in the CI ? This function needs to be called when ever methods like Find.Get the Component Interface 3.

User Profiles. by running the Connect. UPDATE. An Access ID typically has administrator-level database access. Users access to one or more of its access groups. Definition Security in Application Designer.SQL scripts Connect ID means we don't have to create a new database user for every PS user that we add to the system. Permission List. which in turn are associated with an Access ID. and for Windows Clients we specify the Connect ID in the Startup tab of the Config. Permission & Roles. for this we need not reenter the password. Application data. . Roles. Create the Connect IDs. The Access ID should have SELECT. PIA Permission List(PL) ««« is a list of authorizations that we assign to roles.Definition security. Users can run only those processes through Process Scheduler that belong to process groups assigned to their role. the Symbolic ID acts as an intermediary entity between the User ID and the Access ID. User ID stored within an LDAP directory server. Data permissions. Also. Process groups are collections of Process Definitions that we create using PS Process Scheduler. Using Maintain Security we can specify both the sign on times and time-out interval. Page and dialog. such as access to App Designer. Roles enable you to add permissions to users dynamically. we will assign an Access Profile to the user id. PeopleTools. Single sign on? At a time we connect to more than one database. Then they can generate queries on any tables in the access groups accessible to them. appear either through a Primary PL or a Row Security PL. Furthermore. Permission & Roles. Select the highest Access Group that the user can access. It's important to understand that users do not know their corresponding Access ID. Access Groups Permissions.SECURITY Implement security in PS in 6 ways: Signon and time-out. User and Connect IDs only have access to the few PeopleSoft tables used during signon. which are built with PS Tree Manger. Add process groups to permission lists on the Process Group Permission page. W. Specify the Connect ID for an AS in the Signon section of the PSADMIN utility. Security. Batch environment. Manager. they have limited access. Navigation. Process profile definition (defined in Process Scheduler) determines the default Process Scheduler settings for a user. Security. Security. or row-level security. then we need to update only the reference of the Access ID to Symbolic ID in the PSACCESSPRFL table rather than updating with each and every User Profile in the PSOPRDEFN table. Means if we are in HR database. . So that only authorized users can connect to a given database. PeopleSoft Access ID is the RDBMS ID with which PeopleSoft applications are ultimately connected to the database after the Connect ID and validates the User ID and password. Access groups are nodes in a query tree. Is it possible to restrict some users to access specific actions? YES User ID is an ID which we enter at the PS sign on dialog box. it has all the RDBMS privileges necessary to access and manipulate data for an entire PeopleSoft application. PeopleTools. that is. on Portal PeopleTools. which is stored in PSACCESSPRFL. While creating a User ID. All the User IDs are associated with a Symbolic ID.S security controls access to system objects and resources. For example if we had to change the Access ID. User Profiles. A Role is an intermediate object that links the user profiles to the permission lists. which specifies an Access ID and password. PeopleSoft system connects using the Should they try to access the database directly with a query tool using their User or Connect ID. We use Symbolic ID as a search key for retrieving the encrypted value of Access ID. Connect Id we can connect to the Database. PL stores the Sign-On times.SQL and Grant. Database security controls the access to database tables.S/A. after completion of the transactions if we want to enter into FIN database.. and that access is SELECT-level only. Menus. They just signon with their User ID and password and behind the scenes the system logs them onto the database using the Access ID. Select a Tree Name. AD: Go. PeopleTool access. and DELETE access. PeopleSoft encrypts all sensitive data that resides in those tables. Sign on time? Is an adjustable interval during which a user is allowed to sign on to PS. . Open the desired Permission List and select Query.

don't allow them to access AE. peoplesoft applications are delivered with built-in row level security functions.. File. What is Batch Environment Security? or How do you give security to batch programs like SQR and A. Can we run the Definition Security in Browser environment? No. but using the Object security we restrict the total objects. Open. Using the Field-Level security we can control the user access to specific data field. save (save the new group). Purpose of the Definition Security? Using . you can restrict off-line access to batch processes using the security tools described in your platform manuals. The run controls are set up using PS Process Scheduler. Using the User Security we can controls the user access into PS applications. which are groups of batch processes. Open. and only authorized application servers can connect to a given database.E? There are three levels of security for batch programs: Each batch program has a run control that we define before we can run the batch program. Diff: Maintain security and Object/ Definition Security? By using the Maintain Security we can restricts the users to access the particular functions like some pages. you set up Process Groups. Only authorized users can connect to the web and application server. Users can run processes that belong to the Process Groups assigned to their security profile. AD: Go. Then in PeopleTools Security . People Soft applications implement row-level security by using a SQL view that joins the data table with an authorization table. users can have access to a table without having access to all rows on that table. Ex: if we don't want a developer to touch AE programs. Gray. . Like Hide Unhide. Using the Row-Level Security we can controls the rows of data that can be accessed by each user. How can we establish the Object Security? By using the Definition Security PeopleTool. Also using PS Process Scheduler. Then specify the PL. Group Then specify the Group Id. also known as runtime security. This type of security is typically applied to tables that hold sensitive data. it is applicable only in windows ET. Note: Add the Process Profile Permission List directly to the User Profile. not to an intermediary Role. Permission List. But not for the end users.you add Process Groups to a security profile. Then Save. How to implement Row Level Security by operator id? You can design special types of sql views security views to control access to individual rows of data stored within your application database tables.At what level we can setup the PeopleSoft application security? (User Level Row-Level Field-Level Object level) User Level security? By using the Maintain security PeopleTool we can establish the user security. PIA Security is in the category of PS online security. New Group (Here we can specify all the objects which we want give the permission to access the user). some records. How many objects we can develop using the Definition Security? Only one objects that is Group ID. Definition Security in Application Designer. After creating new groups if we want to modify the group then go to File. . tailored to the specific application. we can restrict particular objects from application developers. Then assign groups to the PL. Row-Level Security? use? Row-Level Security is implemented by using the SQL Views. Ungray. Row Level Security? With row-level security. File. File. In your RDBMS environment. Field-Level security? use? By assigning the PeopleCode to the field.

Build Supporting Definitions comprising the steps. Roles. Workflow programs are defined on a record definition for one of the tables that the component accesses.a text comment that appears in the user¶s worklist. the presence of this field automatically suppresses the display of any application fields. Worklistname .the activity that triggers the worklist routing. For example. the presence of this field automatically suppresses the display of any application fields. such as PeopleCode that evaluates a condition and triggers a notification (a routing) when appropriate. the text might be the name of the employee who submitted the report. events. Eventname . such as clerks or managers. and email and worklist routings. If the order is approved. A role is a class of users who perform the same type of work. 2. the system performs the routings. « For example. Workflow Peoplecode. notification is sent back to the person who submitted the original order. You can merge the activities of multiple users into flexible business processes to increase efficiency. Your business rules typically specify which roles do which activities. Routings? . The term workflow refers to this larger process. and business processes required for your workflow as determined in step one.the worklist in which the work item is waiting. you are really initiating an approval process: someone else reviews the order and either approves or denies it. Appropriate values might include the key data for the record in which the item will be worked. 1. worklist_url -the text that links to the page where the user can work on the item. Routings make it possible to deploy applications throughout the enterprise.Roles describe how people fit into the workflow. Events. when you order supplies. - Create Workflow Maps -Create the workflow maps 2.the business event that triggers the worklist routing.Rules determine which activities are required to process your business data. although the key fields are still used to bypass the search page of the target page. For example. the text might be the name of the employee who Submitted the report. - Test -Test your workflow. Define Worklist Records . worklist_descr . The PCode detects when a business rule has been triggered and determines the appropriate action. cut costs.Designing a Workflow Application -Analyze and document business requirements. :System fields: The first fields in a worklist record definition must always be the Following system fields. required for your workflow. and keep up with rapidly changing customer and competitive challenges. 2. They work through the levels and departments of an enterprise to bring together all of the roles that are necessary to complete complex tasks.Document the workflow object attributes for business processes. each work item has the same transactionid. a rule can say that department managers (a role) must approve external course requests EX: User list roles. - Define the Workflow Objects -This is the step in which you define the workflow application. . steps. You enter each of the objects onto a business process definition in Application Designer as determined in step one. when an event triggers multiple routings. a work item directing a manager to Approve an expense report. completing the step. Query Roles.Routings specify where the information goes and what form it takes: email message or worklist entry. you might implement a rule that says department managers must approve all requests for external classes. Activityname .Define Roles and Role Users . Define Event Triggers -Define the business rule in PeopleCode on the triggering application record definition. although the key fields are still used to bypass the search page of the target page. worklist_descr . Appropriate values might include the key data for the record in which the Item will be worked. When a user saves the page.Define the roles and the role users. activities. which is attached to the record definition underlying a step in a step map. Its structure is predefined Having 6 required fields. They contain the business rules used to decide whether to trigger the business event. You implement rules through workflow events. Approvals Events are conditions that have associated routings. .a text comment that appears in the user s worklist. a purchase order is sent to the vendor. . 3. for Work Flow: Application fields and Worklist display fields : The last two fields in a worklist record definition are for descriptive information that appears in the worklist. or use the workflow monitoring tools in Workflow Administrator to validate worklist routing results.Create a record definition that will be used to store all of the application-specific information for the worklist. If it is denied. . Rules. -Diagram the process flow. Define the condition in PeopleCode. If the condition is met. activities. but a different instance id For example. . for a work item directing a manager to approve an expense report.Define Workflow? Workflow enables to efficiently automate flow of time-consuming business processes and deliver the right information to the right people at the right time throughout enterprise. What is a worklist record? Worklist record is the record that is used in workflow. the system runs the PeopleCode program to test the condition.the business process that includes the work item. For example. including any Query roles. 1. Transactionid -the system-assigned transaction id for the work item. Steps involved in Workflow? . Instanceid -the system-assigned id for the work item. Busprocname .

PS_PERS_NID. What are components of PIA? Web browser. PS_LEAVE_PLANS. PS_CUSTOMER_TBL//// « (PSDB Structure Is this way only. The server then provides the HTML to the WS for delivery to the browser. PS_LOCAL_TAX_DATA. The approval steps that you place on the approval rule set map represent the approval levels that are required for the activity. What are the different types of tables in PeopleSoft and give one example of each? 1) System catalog tables . PS_JOB_TBL. PS_PAY_DEDUCTIONS. PS_DEPT_TBL. What is PIA Architecture? In PIA end users do not have any peoplesoft specific software installed on their machines. PS_JOB. you add a PeopleCode program to the workflow event in the record definition for one of the tables to which the page writes. PS_HEALTH_BEN. they use Internet browser to connect web server. Jolt is a java based communication protocol. PS_PAY_LINE. PS_FED_TAX_DATA. The Web server includes Web services software that displays the HTML to the browser. The AS also plays a role in connecting development workstations to the database for three-tier connections. What is Tuxedo/Jolt? Tuxedo manages the multiple connections to the database. PS_PAY_BONUS. Database server What are major tasks that the Application Server performs in PIA? The AS maintains a persistent connection to the database. PS_BEN_PROG_PRATIC. PS_STATE_TAX_DATA. and converts peopletools and application table data into HTML.SYSOBJECTS. App. It also includes java servlets that manage each session s connection to the application server. PS_PAY_CHECK. Batch server. The assembled HTML is sent to the web server. PS_LOCATION_TBL. PS_POSITION_DATA. PS_RTRMNT_PLN.PSRECDEFN. What are the major tasks performed by the Web Server in PIA? Web server acts as the front end of the PIA. server. .PS_STUDENT_DATA. Web server. PS_LIFE_BEN.) Important Tables in HRMS? PS_PERSONALDATA. PS_EMPLOYMENT. Approval processes are a common form of business process. PSPNLDEFN 3) Application Tables . which interacts with application server. SYSCOLUMNS 2) People Tools Tables .To trigger a business event from a page.

using the information in the export file.DMS file from within a PeopleSoft Data Mover script. regardless of the underlying operating system or database platform. regardless of the underlying operating system or database platform. Control database security and access. Data Mover enables you to perform the following tasks: - Transfer application data between PeopleSoft databases. IMPORT: Insert data into tables using the information in an export file. - Export data in a platform independent manner. then all errors produced by the SWAP_BASE_LANGUAGE command are ignored. edit.Why do you use DM? Data Mover «. or a field in all records. and indexes for the record. What are Data Mover operating modes? -Regular Mode: Using PeopleSoft User Id. Move PS databases across operating systems and database platforms. SET IGNORE_ERRORS: If this command is set. which means using the database access ID and password at the signon screen. a field in one record. In regular mode. or a with a command line interface on either Microsoft Windows or UNIX systems. Move PeopleSoft databases across operating systems and database platforms. Bootstrap mode is also used for running some security commands. The file cannot contain nested RUN commands. REM: For Remarks -RENAME: Rename a PeopleSoft record. edit. Commands in Data Mover? - -Bootstrap Mode: Using Database access Id - - - ENCRYPT_PASSWORD: Encrypt one or all user passwords (operator and access) defined in PSOPRDEFN for users. Typically. it forms a statement that establishes the conditions under which PeopleSoft Data Mover runs the PeopleSoft Data Mover and SQL commands that follow.Data Mover? PeopleSoft PeopleSoft Data Mover is a stand-alone two-tier program. RUN: Run a specified . you need to signon on to PeopleSoft Data Mover in bootstrap mode. Delete data in existing tables and insert the corresponding data from the export file. ENCRYPT_PASSWORD. this command creates tablespace. all commands are valid. Control database security and access. and run scripts. Create. You can use the generated export file as input for migrating to another platform. SET: When a command is followed by valid SET parameters. . you simply enter your PeopleSoft user ID and password at the sign on screen. Explain about . which you can run through a graphical interface on Microsoft Windows. EXPORT: Select record information and data from records and store the result set in a file. Otherwise. the command inserts data into the table using the information in the export file. and inserts the data. Create. Bootstrap Mode At times. Execute Structured Query Language (SQL) statements against any PeopleSoft database. the system stops on errors. using bootstrap mode is necessary for database loading because there are no PS security tables established yet. and run scripts which combine SQL commands and PeopleSoft Data Mover commands for exporting and importing data.enables you to perform the following tasks: Transfer application data between PeopleSoft databases. What are the different modes in DataMover? Regular Mode Most of the time you will sign onto PeopleSoft Data Mover in regular mode. These scripts may include any combination of SQL commands and Data Mover commands for exporting and importing data. REPLACE_VIEW: Recreate specified views found in the database. Execute SQL statements against any PeopleSoft database. REPLACE_ALL: This is a variation of the IMPORT command. REPLACE_DATA: This is a variation of the IMPORT command. If a tablespace or table does not exist. To do this. Then. If a table already exists. table. use this command to drop the table and its indexes from the database and create the table and indexes using the information in the export file. such as.

You will need to understand how transaction and control tables work to effectively use the PeopleSoft application. benefits data. The PeopleSoft System resides in a relational database. such as invoices.'11720') and position_nbr not in ('00002025'. '11730'. Most control tables are maintained at the UNDP Headquarters. pay calendars. Control table information is organized and stored by a set identifier. Job Code etc. Employee and Proposal transaction tables. organization structure or processing rules. When you create an invoice.set log c:\temp\position_inputlogfile. Benefit Plans. job history.import *. -set input c:\temp\position_data.Sample Data Mover code? -set output c:\temp\position_data.'00002030'. you will learn: 1. A Business Unit at the UNDP organization. Control tables are generally static.'00002027'. However.'11804'.txt.'00002026'. The PeopleSoft application store information in two types of tables transaction tables and control tables. Control tables include pay groups. appropriate to your business processes.dat. What is a transaction table 2. EGY10 Egypt and IND10 India. country offices and field users should still understand how a control table works since it defines the accounting structure and business rules that are used to process transactions in PeopleSoft.'00002032').dat. departments and job codes.'00002029'. Transaction tables store data about day-to-day activities. the default SetID is SHARE . The type of transaction varies. In this topic. commonly called a SetID. What is a control table 3. Most field users will only be entering records into transaction tables. you will be entering records into the respective Invoice. export position_data where location in ('11490'. Control tables defines the accounting structure and business rules that are used to process transactions in PeopleSoft.txt.'00002031'. . How you use transaction and control tables Information in transaction tables is organized and stored by Business Unit. they change only when you perform specific maintenance. . . A relational database consists of a series of tables that are related to at least one other table by key fields. set log c:\temp\position_logfile. paychecks. Because of this. A TableSet is a subset of data within the control tales includes that defines the accounting structure and processing rules for a particular business unit or group of business units. employee names and addresses. is one of the various agencies or country offices such as UNDP1 UN Development Programme. such as Business Unit. hire employee or update proposal information. At UNDP. these tables are updated frequently and can be quite large.

move. A special type of program used as a daemon process. Is used by PeopleSoft Import utilities. and run background SQL processing programs.remaining are 3rd party tools. What is Application Engine? PSAE program is a set of SQL statements.APPLICATION ENGINE What is the difference between a Process and a Report? The Process receives a command line parameter where as the Report receives run controls from the page. means we can develop.exe AE includes two distinct components: one is the "front-end" used to define batch program and the other is "back-end´ used to run the program what we developed. How many levels of actions support the Application Engine program? Application Engine supports up to 99 levels of nested Call Section Actions.E we can run parallel processing Meta SQL support is there. test. Another special program type used to support XSLT. Using A..exe and It is written in standard C++. What are the advantages with Application Engine over SQR and Cobol/SQL? A. Application Library? Application Library is program that contains collection of callable sections.E is a People Tool Object. 2. AE is designed for batch processing where we have a large amount of data that must be processed without user intervention. PeopleCode. We can use PSAE for straight row-by-row processing. and so on. up to 99 calls. the first called Section can call a second. For example. What is meant by Scheduling processing? Processing the data without user involvement. 1. It is a Development People Tool designed to create applications. What should we get when we open a new Application Engine program? We can get only one section that is MAIN and Step01 (with no actions yet).The main advantage is restart facility. What is the purpose of the Back Ground SQL Process? We can validate the data. We can¶t run the Application Library as a standalone program. We can update Database. but the most efficient AE programs are written to perform set-based processing. «. Is used in PeopleSoft Upgrade utilities. update DB data) background SQL process. We can move the data from one or more tables to one or more tables (Reporting Tables). Program Types: y y y y y Standard Upgrade only Import only Daemon only Transform only A normal entry-point program. Ex: calculating the salaries in payroll processing PSAE. these applications are useful to perform the (validate. 2. and program control actions that enable looping and conditional logic. . What is the purpose of the Program? An AE program identifies the set of processes to execute a given task. And this file resides in c:\<PS_Home>\bin\Client\Winx86\PSAE. which can call a third.

What is the sequence of execution of A. Ignore: It will write message-to-message log and continue. They are saved at commits and checkpoints.How many types of components can include the Application Engine? Application Engine includes two distinct components: one is the "front-end" used to define batch program and the other is "back-end´ used to run the program what we developed. a business process is triggered when the CI saves the page. Later: don¶t commit now. Can we have commits after every step? Yes we can have COMMIT after every step. If the component has associated Workflow PeopleCode. So they can be used for restarts. Bulk insert option can speed up your program with in a loop. Avoid using SQL execution logic in a people code action. Program? By using temp tables we can improve performance. By using traces and reusing options. program actions? Do When Do while Do select SQL\ call section People code Log message Do until Why call section and SQL are mutually exclusive? Both SQL and call section is used to perform DML operations so we will use either SQL or call section.e. . one row at a time. If an AEPROG returns multiple rows of data²for example. Frequency: Only available in Loops.SavePreChange (Record) SavePostChange (Page) 2). Default: uses value supplied for the section. Component variables are same as Global incase of the AE. for running the Batch process we use AE and CI AEPROGs trigger business events indirectly. Global / Component These variables are available while the Application Engine program is running. What are the parameters of the steps? Step Name: We can specify the Step name. if it finds several overdue items²the agent passes the rows to the CI. Why do you use CI in AE? 1.) 2.E. 2) Component/Global People code variables 3) Temporary records Multiple rows of data can be passed. I. Application Package is a set of classes.E.Workflow Subscription (Message) FieldChange. Step Description: We can write some description about the Step. On Error: We can specify any one action to take when an error occurs. What are the Different ways pass data between the steps? 1) State records One row can be passed and can have many state records. Commit After: We can determine when commit will be executed. In which events of people code we can write CallAppEngine function? You need to include the CallAppEngine PeopleCode function within events that allow database updates. To run the Batch process Improve performance of A. How can you integrate a wokflow to an AE PROGRAM? Through CI. Comment: We can add additional comments for this Step. There are different types of VARIABLEs in the AE people code? Local variable these are available for the duration of the program in which they are declared. After step: commit when step completes. by passing the results of their queries to the CI. To access the PS data associated with component by an external application i. Instead use the logic in Do Conditions. Abort: The program terminates and will write the message-to-message log. 6. which triggers Workflow PCode. (Or) The AEPROG runs a SQL query against the PeopleSoft database and passes the results to a CI. but the program will continue. JAVA. (VB.e. Suppress: no message will be written. This includes the following PeopleCode events: 1).

This gives your program multi-language capability. It contains SQL that tests for a condition. SQL action? SQL Statements are used to perform the DDL. just call it. If a Section already exists in one program. Abort: . Call Section? Call Section is used to call one section from another section. INSERT.The program continues processing Skip Step: . the step terminates. but program will continue. 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. People code Action: .Error handling or Exception handling in Application Engine? Step properties:On Error:Abort Write message to message log and terminate. This is the first executable statement with in the step. If the condition is true then it returns a row of data. Do While? It is a SELECT statement that runs before subsequent actions of the step. If this is the last step in the section. Do When? The Do When action is a SELECT statement that allows subsequent actions to be executed if any rows of data are returned. Continue: . DO until? A Do until action is a Select statement that runs after each action when a step completes. 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.Application Engine exits the current section immediately. uppress No message will be written. DELETE. and it executes the subsequent actions within the step.Program terminates Section Break: . Any substitution parameters are written to PS_MESSAGE_LOGPARM . 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. Do While is nothing but a While Loop. If there are no more steps to execute. Do when nothing but an If Loop is.Exits immediately Not recommended.The program exits the current step. rather than copying it into another program. the program will end. Majority cases we are using the DML commands (UPDATE. the calling step resumes control of the processing. DML.E program. Skip Step:. Ignore .Write message to message log and continue. and control returns to the calling step. SQL Action properties:No Rows:. only use skip step at by-pass the commit. or it can be in an external program.Exits the current step and section and control returns to the calling step. and continues processing at the next step in the section.When the Sql doesn t return any rows. SELECT). If the condition is false then no row of data returned and it terminates the entire step. If the Select returns any rows of data. Do Until is nothing but a Repeat Loop. you can tell what application engine program should do. Break:. and DCL operations. Log Messages? A Log Message Action can be used to write a message to the MESSAGE_LOG based on a particular condition in the program.On return options can used to handle run time errors. The Message Log refers to the People Tools table (PS_MESSAGE_LOG) where execution messages reside. The "called" Section can be in the same program as the calling Section.Application Engine exits the current step immediately and moves on to the next step. Abort: . people code ? People code provides reusing common faction libraries of A.

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. If AE_APPLID is not present or is blank (at run time). and the Program ID field with the symbolic value %AEAPPLID. just call it. AEPROGRAMID So depending upon the condition the values are moved to parameters specified above.It opens the cursor and closes the cursor on each iteration of the loop. Do Select is a test condition. Logic in Actions of the step should be such that it will be changing the status of the rows in the table the do select is selecting. Restart able: similar to select/Fetch but it WILL COMMIT inside the loop thus allowing the checkpoint to the PS_AERUNCONTROL table. If a Section already exists in one program. These two fields must be defined on the default state record for the program. Selecting dynamic automatically populates the AE_SECTION field with the symbolic value %Section. "DO while . You enable a dynamic call by first having your program store different section names in the AE_SECTION field. It returns a row. At runtime. and different program names in AE_APPLID field. Commits are not ignored and will be committed in a reselect loop when the restart is enabled.It will reselect the same row of data. If AE_SECTION is not present or is blank.Opens the cursor only at the first time and retrieve rows one at loop. We will keep two fields in the state record like AESECTIONNAME. What is Call Section? What does dynamic attribute in Call Section do? Call Section is an action which calls other sections. . DO until" actions always checks the condition whether it is satisfied or not. . It works like a FOR loop. rather than copying it into another program. Difference between Call Section action and Dynamic Call check box? Call Section is used to call one section from another section.exit(1) when we are using this functions in AE Exit (1) causes immediate termination of a PeopleCode program. "DO When". What are different types Do Select? 1) Select/Fetch 2) Reselect 3) Restart able Select/Fetch: . No importance for the data updates. The values you insert in these fields are normally based on various conditions met within your program. These two fields must be defined on the default state record for the program. Reselect: . Exit (0) caused immediate termination of a Peoplecode Program but don t make rollback in the database. 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. When issuing a dynamic call. DO When" always executed only once. what is the difference between exit(0). or it can be in an external program. the current program is substituted for the AE_APPLID value. Use this parameter to rollback database changes. At runtime. an error occurs. both the section and the Program ID must be dynamically set.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. the program calls the section name stored in AE_SECTION that belongs to the program name defined by AE_APPLID. the program calls the section name stored in AE_SECTION that belongs to the program name defined by AE_APPLID. create a Call Section action that calls the section name defined in the State record field by selecting the Dynamic check box. and the Program ID field with the symbolic value %AEAPPLID. Where as SQL executes DML and Meta SQL. It has attributes: Section Name/ Program ID/ Dynamic(Check Box) When you want to call the section during run time you will check the dynamic. 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. Commits inside the step (commits in the Called Section) are ignored if AE is Restart enabled. The "called" Section can be in the same program as the calling Section.

Bulk Insert offers the most powerful degree of performance enhancements related to ReUse. "No rows" action property is available for "SQL" action and "Do select Type" property is available for "DO select" action. The number of rows allowed to gather in the buffer depends on your database platform. restart facility will not be available because data is not updating the database after every row of data. if the condition is satisfied. There are 3 options a. Keep in mind that storing data in the buffers is applicable only if you·ve selected Bulk Insert and the SQL is an INSERT statement. Select this option to enable basic ReUse functionality. dedicate a cursor. ReUse Statement Enable to optimize the SQL components of your batch program. Action level properties are different between these two options. if the condition is satisfied.With this option.restartable a) select/fetch . In "Do when". compiling each statement you issue can be a considerable performance issue. enabling the AE runtime process to compile the statement once. ReUse is disabled. ReUse converts any %BIND references to state record fields into real bind variables (:1. immediately updates the database. For statements other than INSERT/«VALUES.In "Do when". system executes the next action called "DO SELECT".select/fetch b. 2. and. b) reselect . once all rows in cursor are updated then updates the database. and then re-execute it with new data as often as your program requires.reselect c. then system executes from the "DO WHILE" of the same step.With this option. if the condition is satisfied. %BIND (ref2). no cursor is used. in addition. The difference between writing SELECT(%select) statement in 'SQL' action and 'DO select' action. it holds all the data in a buffer and performs an insert only after a large volume of rows has gathered in the buffer. In "DO UNTIL".opens a cursor and updates the cursor with the values. In this process. Restart facility is available for this option. inside a fetch loop. field2«) VALUES (%BIND (ref1). This option turns on ReUse. By default. and so on). the AE runtime process recompiles the SQL statement every time the loop executes. Reuse statement property is common between these two actions. if the condition is not satisfied. 1. . then system executes the next step because "DO UNTIL" is the last action of the step. No Yes Select this option to disable ReUse. When ever the record is updated. ReUse is a way to combat potential performance decreases. In "DO UNTIL". "PEOPLE CODE" and "SQL/Call section" actions. one at a time. the Bulk Insert option is ignored. With ReUse off. In "Do while". 3. if the condition is not satisfied. system executes the next action called "DO WHILE". When you are using SQL to process a large volume of rows. :2. every record updations updates the database immediately and also facility to keep break points which are useful for commit at break points. system aborts program. You have the following options to apply ReUse to your SQL actions: Bulk Insert When used in conjunction with statements like INSERT INTO tablename (field1. c) restartable .

State Record used as a worktable. steps.E programs use same state record as default state record then there will be multiple rows in state record.. we can specify only character and numeric fields as required fields. --.(Temp Tbl) Can we specify the Date type field as a Required field? NO No. No people code fires on AE state record. %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 Define the following Meta sqls %Bind: Used for retrieve data from the state record %Select: Inserting values in to state record . while sections. But in case if multiple A.There is only one row in the state record for each process instance.STATE RECORD (CACHE RECORD) Tell me what you know about state record? (Cache record) State records are used to assign variables for Application Engine program. What is Prerequisite for the State record? 1) Should be either Derived work record Or SQL Table.4 state Record %Table: For referencing a table across multiple databases %Truncate: To delete the temporary table. this is how the system identifies the record as a state record.stores data into the State Record.gets data out of the State Record. i. one row for each record.We can specify both work (derived) and ´physicalµ (SQL table) records to be used as state records. 3) PROCESS_INSTANCE must be a key. ___________ . 4) Any data types except character or numeric must not be required fields.%BIND . How many rows we can have in state record? We will have one row in state record. --. What Meta SQL is used to store values into a state record? %SELECT.e. Used For Restart facility in AE Program. --. --.A PS AE state record must have a Process Instance defined as the first field and the only key field --. and so the values would be lost during a restart. --. Key field is Process_instance. To restart facility we put the Process_instance field. 2) Name of the record must end in AET.For assign variables for our Application Engine program through state records.%SELECT . and actions pass values to subsequent program steps through state records. What Meta SQL is used to retrieve values form a state record? %BIND.The only difference is that derived state records cannot have their values saved to the database at commit time. --. It can be a derived work record or SQL table. State Record: Assign variables for your Application Engine program through state records. or program. What field is used as the key field on a state record? PROCESS_INSTANCE«.

EXE (or delete to enable restart) ««««. On the Advanced tab in the AE 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. 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. Select the Process Scheduler tab and select or clear the Disable Restart check box appropriately.If in any of these three places you've disabled restart. Then.E program where it was stopped.E program properties dialog box. column2 Delete processed rows. then restart is disabled. you could have the Restart flag enabled. What you need to do for making restart facility in A. In configuration manager Profile select the process scheduler tab and uncheck the disable restart. (If you are DEVELOPING programs and are ready to TEST but don't want a RESTART condition to get in the way. you could have the Disable Restart check box on the Configuration Manager selected. Select the Profile tab and click the Edit button. include the option ²DR Y to the command line of PSAE. From PS_TABLE1 Where processing_switch = µN¶ . If the section is updating permanent application tables in the database we should select critical updates. or if you are invoking your program from the command line. This allows you to TEST new development and avoid errors about forcing you to restart during your TESTING. We have to select the restart check box in A. If the section is only preparing data as selecting it populating temporary tables or updating temporary tables the section type should be prepare only. To disable.E program? At least one state record needs to be physical record as the data will be available in case of abend. Start Configuration Manager. What we have to do for RESTART facility? Program level: One state record should be sql table. At the same time it prevents you from inadvertently leaving Disable Restart selected in the Program Properties when you moved the program into PRODUCTION.What is restart facility? The restart facility is used to restart the A. 2. you could leave the Disable Restart check box clear in the Program Properties..) To enable or disable RESTART in PS Configuration Manager: 1.

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. which consists of row and columns. Temporary Tables are used to insert or delete the data without interrupting the main record. If the runtime options are set to continue People Tools will insert rows into the base table using the PROCESS_INSTANCE as a key .E PROGAMS Temporary Table: Temporary Tables are used to store intermediate data. What is temporary table and Instances? (Work record) used to store temporary values. multiple instances of the same program often execute in parallel processing.The max number of instance count for batch programs is 99. column2 Delete processed rows. then you would set the Instance Count to 5. 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. Temporary tables are used for Set Processing and Parallel Processing. and each program instance inserts the rows from the source table into its assigned temporary table instance using %Table. . Typically. you should change the Temp table runtime options to Abort in the appropriate AE programs. The max number of instance count used by online programs is 3 to 10 Total temp table instances are 99+10+1(Main table) = 110 Instance Count: The Instance Count value controls the number of physical tables to be created for each dedicated table for this program during the SQL Build procedure in Application Designer. Temporary tables are used for parallel processing. Temporary Tables improve the performance of the program. there is a significant risk of data contention and deadlocks on tables. set processing to increase performance of the program. Temp table instance count for batch programs will be set in AE program properties (Under "Instant Count" edit box). Temporary table is buffer allocation. What happens when all the INSTANCE of the temporary table are in use? It behavior can control by AE developer. Temp table instance count for online programs will be set in PIA under people tools > Utilities > Administration > People Tools option. When this happens. From PS_TABLE1 Where processing_switch = µN¶ TEMPARARY TABLES (Work records) IN A. you would set this number to equal the number of parallel program runs that you anticipate. If temp table doesn t contain PROCESS_INSTANCE as a key field in a Temporary table. To avoid this PS PeopleTools has a feature that enables you to dedicate specific instances of temporary tables for each program u run. For instance if you expect up to five instances of the same program to run simultaneously. AE programs run in batch mode. Instances determine the no of temp tables to be created. U can also use temporary tables to improve performance.

PROCESS_INSTANCE | and OPRID = | %oprid. that s why applying the set processing.This process is effective when single row needs to be updated from a group. %PROCESS_INSTANCE is more efficient and faster What is SET PROCESSING? Set processing is nothing but processing sets of rows at one time rather than processing each row individually. In this scenario.E run control record? A. In this scenario only persons salary will be increased. all people under those dept salaries will be increased. In this scenario.%Select (EMPLID) Select EMPLID from PS_AERUNCONTROL where PROCESS_INSTANCE = %PROCESS_INSTANCE and ORPID = %oprid 2) People code: .E program > program properties> temp tables Select the table you want Open app designer Open the record Build the record Save Click ok Save the program What is restart facility? The restart facility is used to restart the A. 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. Ex: .&SQL = Select EMPLID from PS_AERUNCONTROL Where PROCESS_INSTACNE = | PS_TEST_AET. Set processing: . only manager under that dept salary will be increased. What is A.E program? Open A.E program where it was stopped. thats why apply the row by row processing.E Run control record stores the values of A.E program parameters.Diff between _TMP and _TAO? For on line process we will use _TMP and for batch process we will use _TAO How you assign the temp tables to A. UPDATE PS_XXXXX SET FIELD1 = XXXXXX SET FIELD2 = XXXXXX WHERE DATE > CURRENT DATE. %PROCESS_INSTANCE or %Bind (PROCESS_INSTANCE) can be used. How to read the RUNCTRL PARAMETERS in AE 1) SQL: . This is group of people.Increase the salary for the manager from any dept whose dept profitability is more than 5 Million dollars. Row by row processing: . Ex: .Increase the salary for all employees from any dept who's dept profitability is more than 5 Million dollars. The following concepts are particularly important: * Group by and having clauses * Complex joins * Sub-queries (correlated and non-correlated) * Tools for your database to analyze complex SQL statements for performance analysis Set processing: This is process is more effective when group of rows need to be updated.Update database with out selecting the records. .

you will enter the PeopleCode Debugger at that point. the record contains and EFFDT field (effective date). y Application Engine supports what type of Debugging Tools? 1. hardware. procedures or application software. some databases can get a considerable performance boost. 3.EXE. Code %Table Meta SQL as reference to Temporary Tables in your AE program. system software. database.E program? You can set the Debug option in the following locations: y y Start PeopleSoft Configuration Manager and select the Process Scheduler tab. When you launch your program and the PeopleCode Action executes. Bulk insert is ignored. 2. How do you Debug an A.Parallel Processing? The ability for multiple instances of the same program to run simultaneously is called parallel or concurrent processing. due to some problems the output is not what we expected. you should also enable the PeopleCode Debugger. PS AE offers this non-standard SQL enhancement on the some databases: Oracle. If you used the command line option to invoke your AE program. and DB2. DEBUGGING OF A. and the record contains a Mobile trigger« In this conditions are true. Set the Temporary Tables Online pool. . If you already have the Debug check box selected in PS Configuration Manager. Build / Rebuild your Temporary Table record. U should consider using this feature only when the INSERT SQL is called multiple times in the absence of intervening COMMITs By buffering rows to be inserted. This feature is named Bulk Insert. Microsoft SQL Server. enable Debug by selecting the Debug check box. Set Temporary Table Batch Pool Instance count in the AE. This is the method that applies to all methods of invocation. Assign Temporary Tables to your AE program. The database platform is Oracle. In the Application Engine group. then you do not need to include the ²DEBUG parameter in your command line. the problem may be the network. Process Monitor Application Engine Trace file (In the Configuration Manager) Application Engine Interactive Debugger PeopleCode Debugger. So that we need to find the mistake. If you have PeopleCode in your AE program. That means we have to debug the program. 4. What is Bulk Insert? Bulk Insert: Inserting buffering rows into database. so that AE can table references to the assigned Temporary Table instance dynamically at runtime. then you can just include the ²DEBUG Y parameter in the command line you submit to PSAE. What are the important steps for implementing the parallel processing? Define your Temporary Tables.E PROGRAMS Why we need the Debugging concept? After completion of the program successfully.

Where can we view the failure details of the AE program? Process Monitor. in the Process Scheduler folder tab in the Configuration Manager. Then it displays all the debugging commands. Click on the profile tab. in command line? After specifying the Debug option in the Configuration Manger. In .TOOLSTRACEPC <trace value> Which Trace option is the best place to start for general performance information? TRACE <trace value> 384 mostly used trace value. How can we access the Debug Commands.E Trace will be there in that we can set trace. What are the 3 trace parameters you can pass to your psae.exe? . Process Definition.E program form command line argument and other? PSAE.E Trace will show the steps and sql issued in the order and complete information. And press ENTER. How do you enable the PeopleCode Debugger for Application Engine? Sign on to PeopleTools using the same User ID that you are going to use to invoke the AE program. Click on the Edit (push button). How can you debug A.1). In configuration manager > Trace tab > A. Select the Debug check box. On the Process Scheduler page. 4). PeopleCode Debugger Mode. Break at Start.E Interactive Debugger? It can be used while running on the client or when running directly on the server out side of the process scheduler. we can SET TRACE option in configuration manager. A Trace parameter determines what type of data is recorded in your trace files (s). What are the 3 common ways to pass a trace parameter and value to your program psae. Select Debug. Your AE program can be open on the desktop. Select Debug. then type a ( ?) .TOOLSTRACESQL <trace value> . but you do not need to open the AE program or the PCode action that you want to debug.exe? Configuration manager.EXE CT <DB_TYPE> -CD <DB_NAME> -CO <OPRID> -CP <PASSWORD> -R <RUN_CONTROL> -AI <PROGRAM_NAME> -I <PROCESS_INSTANCE> How can we set A.TRACE <trace value> . What is the difference between a Trace value and Trace parameters? A Trace value determines which type of trace is turned on. Command prompt. 2).E Trace file? For process running on a windows workstation. This causes the AE program to break prior to executing any PCode program s within it. we will find the Application Engine options. First click on the Trace tab and turn off the statement timings.E Trace file shows you? A. How can we access the AE Interactive Debugger? Set the Debug check box on. Open PeopleSoft Application Designer. When we use A. addition it shows execution timings. Click the OK to save the new configuration. Open the Configuration Manager. Run any program then we will see the DOS communication window. 3). What do the A.

state record]). If you already have the Debug check box selected in PeopleSoft Configuration Manager.exe -CT <dbtype> -CD <dbname> -CO <userID> -CP <password> -R <servername> -AI <AE programID> -I <ProcessInstance> -TRACE 2 How can you debug A. Note.EXE CT <DB_TYPE> -CD <DB_NAME> -CO <OPRID> -CP <PASSWORD> -R <RUN_CONTROL> -AI <PROGRAM_NAME> -I <PROCESS_INSTANCE> How do you execute Application Engine through Push Button? 1) CreateProcessRequest () . What is the syntax for CallAppEngine? CallAppEngine (applid [.E program? You can set the Debug option in the following locations: Start PeopleSoft Configuration Manager and select the Process Scheduler tab. When you launch your program and the PeopleCode Action executes.) AE Trace files: AE_<Program Name>_<Process Instance>. This is the method that applies to all methods of invocation. Setting the debug capabilities in either PeopleSoft Configuration Manager or the command line will turn debug mode on. If you have PeopleCode in your Application Engine program. Select Profile -> Edit Profile-> Process Scheduler Tab -> Application section Select Debug check box. and the command line can override the default.E program form command line argument and other? PSAE.AET. then you can just include the DEBUG Y parameter in the command line you submit to PSAE. AE Interactive Debugger First click on the trace tab and turn off the statement timings. then you do not need to include the DEBUG parameter in your command line. Schedule () 2) CallAppEngine. enable Debug by selecting the Debug check box.Testing And Debugging application engine? AE Trace file-You can track the step execution of your application execution. The only situation where this is not true is when you have Debug enabled in Configuration Manager and you explicitly submit DEBUG N on the command line. you should also enable the PeopleCode Debugger. In the Application Engine group.AET Without the process instance: .AE_<Date/Timestamp>_<OS_PID>. you will enter the PeopleCode Debugger at that point. (You can dynamically modify the state record run AE step by step PCode Debugger for the AE. Running AE through Command Prompt: n:\pt840\bin\client\winx86\psae. In this case. .EXE. the PeopleSoft Configuration Manager setting defines your "default" command line value. _________ How do you debug an A. If you used the command line option to invoke your Application Engine program.

End-If. It is AE-only meta-SQL. step. If you intend to include multiple SQL statements within a single application engine action you should use the meta-SQL construct %EXECUTE. %FilePath_Absolute).Meta-SQL Functions 1) %CLEARCURSOR(program.txt". it must be located at the beginning of the statement and can be the only function or command contained in the statement."). section. When you use the %EXECUTE function. &MYFILE.IsOpen Then &MYFILE. . If &MYFILE. recordname [alias][.WriteLine("Some text. 5) %RoundCurrency( <EXPRESSION>. and then increment (%Next) or decrement (%Previous) the value after the statement is executed successfully. "E".IsOpen Then while &MYFILE. BEGIN FOR counter := 1 TO 10 UPDATE pslock SET version = version + 1.]<CURRENCY_FIELD>) The %ROUNDCURRENCY function rounds an amount field to the currency precision specified by the field¶s Currency Control Field property²as defined in the PeopleSoft Application Designer Record Field Properties dialog box.Close().. field1.E program? How can we validate AE data? What is the syntax for reading and writing a file from people code action? The following example opens an existing Unicode file for reading: &MYFILE. The action type must be ³SQL´. The following example opens a numbered file for writing in ANSI format. %ExecuteEdits(<type>. action) Use the %CLEARCURSOR function to recompile a re-used statement and reset any STATIC %BINDs. the %EXECUTE construct enables you to include multiple statements in a single Application Engine action without encountering database-specific differences. What errors you got when you are running A.Close(). . Also. 3) %ExecuteEdits: Enables PS AE to support data dictionary edits in batch. Note. &MYFILE.Open(&SOMENAME. "N".. 2) %Execute : Enables you to execute database-specific commands from within your Application Engine program. If &MYFILE. "U").]) where <type> consists of any combination of the following (added together): %Edit_Required%Edit_YesNo%Edit_DateRange%Edit_PromptTable%Edit_TranslateTable 4) %Next and %Previous : used when performing sequence-numbering processing. %EXECUTE(/) DECLARE counter INTEGER. [ALIAS.Open("C:\temp\item*. END. / END FOR.ReadLine(&SOMESTRING) /* Process the contents of each &SOMESTRING */ End-While. without overwriting any existing files: &MYFILE. field2. End-If. These constructs use the current value of the number field as a Bind variable.

What are the Component Level Events? PreBuild. Rowinit is used to initialize the rows. Row select people code is used to filter out rows of data. Row Set. In Object-Oriented People code by Instantiating Objects to Record. Field default attempts to set defaults for fields without a value Field formula performs. SavePostChange When workflow event fires? After the SavePreChange fires then this Work Flow Event is fired. PostBulid.only searchinit will fired. You can specify the default value either in the Record Field Properties. or in FieldDefault PeopleCode What are differed processing and its advantages? Postpones some user actions to reduce the number of trips to the database so that increases the performance (in system edits. Row Init 9.RowSet consists of set of rows . Order of Execution of Deferred processing? This is similar to Interactive Processing where as in this FieldChange. Work Flow 17. Field Default 6. searchinit. field formula. What is default processing? In default processing. 2) Increases the performance. Field we can refer the Component Buffer. If default mode for component is new mode: ------.Search Init 3. What is a RowSet? RowSet is data structer repersenting the hierarchical data. rowinit. Sequence of peoplecode events: Searchinit people code performs before the search dialogue box displays. FieldEdit Peoplecode events & System edits will be differed until we press the Save Button. Used this Rowset object to retrieve the data from data & component buffer. Field Edit 11. Search save performs after the operator clicks ok in the search record dialogue box. Advantages: 1) Reduces the network traffic. Post build pc performs after all the component build events have performed. Prebuild 5. after field default completes successfully. and field change). SavePreChange 16. ComponentRecordField. Page. What are the save action events? SaveEdit. Search Save 8. Popupmenu. How do we refer Component Buffer in the Object-Based or Procedural-Based People Code? In Procedural Based People code by using scroll path we can refer. Component Record. Row Insert 13. Row Delete 14. Prebuild is often used to hide and unhide the pages. Row. . Component. Field Change 12. Field Formula 7. SavePreChange. any blank fields in the component are set to their default value. SavePreChange. Activate event is fired every time the page is activated People Code Event sequence Execution 1.field default. Postbuild 1) When we select a component what events will be fired? If default mode for component is search mode: -----. Work Flow & SavePostChange Where is people code stored? Database Server. Save Edit 15. PSPCMPROG 5) what types of PeopleCode events are there? Record field. Where Each Row consists of set of records and child Rowsets. Workflow. field edit. Row Select 4. SavePostChange 2. Activate 10.

Postbuild««. Use to validate the consistency of data in component fields. Diff between FieldEdit & SaveEdit? In SaveEdit it checks for all the system edits & Field edits. Search save. SaveEdit Event SaveEdit event fires whenever the end-user attempts to save the component. which redisplays the page. Diff between SavePreChange & SavePostChange? SavePreChange is fired when the buffer is not cleared where as Save Post change fires When the Buffer is cleared and before the Commit is issued by the database. What is the different between RowInit & RowInsert? The RowInit event fires the first time the Component Processor encounters a row of data. we write SqlExec Update in? SavePostChange . It is performed once field has changed and FieldEdit People code has completed successfully.. If the data does not pass the validation. the PeopleCode PROG should display a message using the Error statement. discarding rows. Events that fire are FieldEdit & FieldChange. Once it is done. which will cause your code to be run twice. It is performed after the field has changed and new value of the field satisfies the standard system edits. If 0 defaults exists for the field then it sets to the system defaults depending on the data type of the field. connects to database and execute. This directly When a Tab is pressed or a field value is changed on the page then this occurs. row insert. How is the searchinit event most often used by people soft application? Searchinit fires before the search dialogue page is displayed to the end use. you should use SaveEdit PeopleCode. Retrieves only one row of data. row delete. It is used for setting the initial state of component controls. Savepostchange fires after the updation of data in the database. database will get updated. Do not put PeopleCode in RowInsert that already exists in RowInit. (Or) In SavePreChange we can get the data from Component Buffer for that particular Component where as in SavePostChange Component Buffer is cleared we have to get data from Database and this is used to update values outside the database. can be used to validate your search data.In which events error & warning are used most extensively. Ddiff between saveprechange and savepostchange? Which function directly interacts with the database? Saveprechange---last event that executes before updating the data from component buffer to the database. What is difference between field default and Rowinit? Field default specifies only the default value for a field when we are in Add mode. Diff between FieldEdit and SaveEdit? FieldEdit Event used to validate the contents of a field. FieldChange event is used to recalculate the field values and perform additional processing based on the new value of a changed field. Whenever a validation involves more than one component field. What is FieldFormula? which is mainly used to do calculations and define functions in Derived work record which can be used as function libraries. What is field change? What are the events fires when a field changes? What is sqlexec function? This is a function which is used to write SQL commands in People code.function directly interacts with the database. filling up scrolls. Can u write the error messages in FieldChange event? No. Why are FieldEdit and FieldChange Events Used? FieldEdit event is used to validate the contents of a field. displaying an error message and turning the field red. save edit.before the commit is issued by db. SQLEXEC --. Savepostchange« will be used to play with tables which are not present in your component buffer. This occurs during component build processing and row insert processing. Field edit. Row init fires only when a row of data coming from database to component buffer. supplementing the standard system edits. For this reason searchinit is often used to enhance row level security by inserting and graying out certain values to the search dialogue page. because a RowInit event always fires after the RowInsert event. If a validation involves only one page field. or a ScrollSelect or related function is executed. Does Save Edit & SavePreChange Are in Component Level or Component Record Level? These are available in Component Level. When the end-user adds a row of data. you should use FieldEdit PeopleCode. can be used to play with the pages (hide. unhide). What is FieldDefault event? Which is used to assign default values for a field without a value. Mainly used for Background SQL processing. Saveprechange« is the last event where you can validate and correct your data before updating the database. Difference between Prebuild & Postbuild events and saveprechange and savepostchange? Prebuild«««. the Component Processor generates a RowInsert event. use RowInsert for processing specific to the insertion of new rows. It also occurs after a Select or SelectAll Rowset method.

The main purpose of the Activate event is to segregate (separate) the PeopleCode that is related to a specific page from the rest of the application¶s PeopleCode. Any subsequent rows are discarded. Difference between SQLEXEC and CREATESQL? SqlExec means it bypasses the component buffer and it is directly contacts database to retrieve data. or if an end-user presses TAB between different pages in a component. However.page_name]) only transfer to a page with in the same component. all of the same type. UPDATE. Transfer is more powerful than the simpler transferpage. autosearch]). . Transferpage ([page. This means when the page is first displayed by the end-user.barname. Transfer can either start a new instance of the application and transfer to the new page there. In the case of Create SQL we can able insert the data in bulk.component_item_name. which permits a transfer only within the current component in the current instance of PeopleTools. a WorkFlow event is generated. You can use SavePostChange PeopleCode to update tables not in your component using the SQLExec built-in function. any variables declared as component do not remain defined after using the transfer function.the Execute SQL object method. is best put in this event. barname.menu_itemname. you could use IT to set sequential high-level keys. But it retrieves the data row by row and not possible for bulk insert. 3. Each page has its own Activate event. itemname. such as enabling a field or hiding a scroll. If your SQL statement (or your SQL. SQLExec sends only the first row to its output variables. and/or DELETE SQL commands. you would put the code for hiding it in this event Transfer and Transfer Page functions Transfer closes the current page and transfers the end-user to another page. it fires the SavePostChange event. use the CreateSQL or GetSQL functions and the Fetch method If you want to delete. for instance. It provides one final opportunity to manipulate data before the system updates the DB. or close the old page and transfer to the new one in the same instance of PeopleTools.Diff between Saveprechange and Savepostchange? SavePreChange Event It fires after SaveEdit completes without errors.sqlname statement) retrieves more than one row of data. If you need to SELECT multiple rows of data. or update a series of records. SavePostChange Event After the Component Processor updates the DB. because only a single row is fetched. keylist] [. What is the diff between SavePreChange & SavePostChange? SavePreChange is fired when the buffer is not cleared where as Save Post change fires when the Buffer is cleared and before the Commit is issued by the database. In Save Prechange we can get the data from Component Buffer for that particular Component where as in Save Post change Component Buffer is cleared we have to get data from Database and this is used to update values outside the database. If SavePreChange runs successfully. This means if you want to fetch only a single row . and then the Component Processor issues appropriate INSERT. insert. use for security validation: if an user doesn¶t have clearance to view a page in a component.menuname. either within the current component or in another component. What are the events at PAGE level how you can use in your application? Only ACTIVE event. (or) In SavePreChange we can get the data from Component Buffer for that particular Component where as in SavePostChange Component Buffer is cleared we have to get data from Database and this is used to update values outside the database. The Activate event is fired each time the page is activated.. Transfer (new_instance. What is diff between Sql Exec and Create Sql? SQLExec can only SELECT a single row of data. action [. whether you¶re transferring within the same component or not. SQLExec can perform better than the other SQL functions. PeopleCode related to page display or page processing. Also. menuname. use the CreateSQL or GetSQL functions then «««. page.

%DateTime: %DateTime returns the current server date and time as a Datetime value. The advantage of . In most cases. 1. When should WinMessage be used? What is the purpose of Gray.DoModal -DoModalComponent Exec (only when Synchronous) File attach functions Prompt -RemoteCall WinExec(only when Synchronous) WinMessage -WinMessageBox. Builtin Functions 2. or until an external process has run to completion. The Gray built-in function will make the field display-only. adjusted for the user¶s time zone %Component: %Component returns an uppercase character string containing the name of the current component.External Non-People code functions 1. %Copyright: This system variable returns a string suitable for use as a standard PS copyright notice. Following are Think time functions: DoCancel . Why are command push buttons used? What are the advantages? Command push buttons can be used to trigger PeopleCode programs. External People code Functions & 4. %DbName: %DbName returns the name of the current DB as a String value %DbServerName %DbServerName returns the name of the current Sybase or Informix DB server as a string %DbType: %DbType returns a string representing the type of the current DB. %BPName: Description: %BPName is relevant when the user has accessed a page from a Worklist entry.What are the System variables? People Tools provides a number of system variables that provide access to system information. %Currency: This system variable returns the preferred currency for the current user. This is helpful when enforcing field level security. as set in the component definition. It returns a string containing the name of the Business Process for the Worklist entry. The Hide will make the field invisible. and UnHide? These built-in functions change the display characteristics of fields on a panel. Hide. Is there any function in peoplecode which stops the processing of whole component? Think-time functions suspend processing either until the user has taken some action (such as clicking a button in a message box). but for AE environments. It returns an empty string if the user didn¶t access the current page group from a Worklist. this is the current date. The record default or FieldDefault PeopleCode can than be applied if appropriate. What are Different Functions in PeopleCode? There are totally 4 types of Functions in People code. Why are All and None used? The All and None built-in functions check for the presence or absence of a value that the operator has entered. %ClientDate: %ClientDate returns the current date for the current user.with the µ%¶ char. it is the processing date of the AE PROG.Internal People code Functions 3. It also can be very helpful when used for debugging.in function must be used when updating the value of a field within a PeopleCode looping statement. -RevalidatePassword The WinMessage built-in function is used to display an information message to the operator without performing normal error and warning processing. UnGray. rather than the µ&¶character %AsOfDate: Description: Returns the as-of-date of the environment that the PeopleCode is running in. They are 1. System variables are pref. When is UpdateValue necessary? The UpdateValue built . What does SetDefault do? The SetDefault built -in function will clear out the contents of the field. This can be helpful since a different value may be stored on the database if a value is not entered into a field based on its type.

What the data buffer classes? The classes which consists of methods which are used to access or work on Data buffer. Application Class 6. What is component buffer?. Java Class Deletedropdownitem () 2. When is the ScrollFlush function used? Is used to remove the rows of data from within a scroll bar without deleting them from the database.File Class 8. Bind variables are then passed if necessary. Returns U ±for Update mode . How to change the prompt table Dynamically? Using People Code function ³%Edit Table´. Select Edit.AE Class 10. They are 1. What are Data Buffer Classes in Peoplesoft? There are totally 4 Data Buffer Classes in Peoplesoft. What are the parameters of a ScrollFlush function? Name of the primary record definition for the scroll bar where the rows of data will be removed. What PeopleCode events will a command push button perform? Any FieldEdit and Fieldchange PeopleCode programs on the field where the push button is attached. Rowset Class 4. 4. How many levels we have? For parent/child relationship. What are the two different ways to retrieve a bitmap to display on the command push button? Bitmaps can be retrieved from a file using the Browse push button or from the clipboard using the Paste push button. and the When Clause within quotes. Bussiness Interlink Class 13. Grid Class 14.Field Class 2. In Object-Oriented Peoplecode by Instantiating Objects to Record.Record Class 4. Row Set. panel Field properties and modify the field entries under the Record tab.It is a temporary memory area for the people code to access the data base columns and user defined variables in the people code. 2. Row Class 3.Array Class 11. What are the built-functions used to control translate values dynamically? Adddropdownitem () 3. What are the Object Classes available in the PeopleCode? 1. (Or) Tempory memory area to Store data related to Current Active Component 4.Record Class. Rowset Class 5. 3. How do we refer Component Buffer in the Object-Based or Procedural-Based PeopleCode? In Procedural Based Peoplecode by using scroll path we can refer. Are you used Scroll Area.Field Class 7.Query Class 15. Row. What are the parameters of a ScrollSelect function? First the occurs level number and primary record definition of the scroll bar the data will be selected into. SQL Class 2. Component Interface Class 12.Page Class 9.4Levels 2. How do you attach a field to a command push button? A field is attached to a command push button in the panel definition. Is there any way by which you can find out whether the user is in Add mode or Update mode? %mode---returns A-for Add mode. 5.using one is that the operator determines when the program should be performed.Row Class 3. Field we can refer the Component Buffer. These are followed by the select record.

A row may have one to n child rowsets. the level zero contains only one row of data. the level 0 rowset may contain more than one row of data. and other definitions besides components. A single row in a component scroll is a row.) Data buffer access class objects can be of type Local. *A rowset is a data structure that describes hierarchical data. which in turn contain rows of data that contain other child rowsets. . an AE or app. Records contain the fields that make up that record. *A level 0 rowset from a component buffer only contains one row. *You can use rowsets with application messages. Relationship between the classes The 4 data buffer classes relate to each other in a hierarchical manner. that is. a row in a level 2 scroll may have n level 3 child rowsets. records. application engine etc. DATA BUFFER: A data buffer contains the data of the currently active PeopleSoft application. rowset object is a data structure used to describe hierarchical data. Row object instantiated from row class is a single row of data containing one to n records of data. Creating objects to access data: Each data buffer access class has its own data type which is the same name as the class. think of a rowset as a scroll on a page that contains all of that scroll s data. (Dot notation). The classes and their methods can be accessed using the dot notation. message etc. that contain other child rowsets Accessing data in a component buffer The data buffer classes are used to access data in the component buffer i. the keys that the user specifies to initiate that component. *A rowset contains one or more rows. *A row contains the records that make up that row. Global. It may also contain child rowsets. It can be from a component. might contain more than one level 0 row. For component buffers. If the level 0 rowset is formed from a component buffer data. rows and rowsets:------------------------------------------------------The foundation classes to access data in component buffer (apart from the built in functions) are: Field object which is instantiated from the Field class. A level 0 rowset from data that isn't a component. field objects as type Field. such as a message or a file layout. Each row of the level 0 rowset contains all the child rowsets associated with that row. Business Interlinks. It is made up of a collection of rows. Usage of these classes provides improved functionality. A component scroll is a rowset. Data in the component buffers can be accessed using the built in functions and the object classes using the people code object syntax. the data loaded when component is activated. A level 0 rowset contains all the data for the entire component. file layouts.Component Buffer and Data Buffer COMPONENT BUFFER: The component buffer contains data of the currently active component. If the level 0 rowset is formed from the data buffer. flexibility and consistency. For example. or Component. In addition the classes can also be used to access the data in buffer loaded due to activation of application message. *A row contains one or more records and zero or more child rowsets. Record object which is instantiated from the record class is a collection of fields. which in turn contain rows of data.e. That row contains all the child rowsets. The main points to understand these relationships are: *A record contains one or more fields. -------------------------------Fields. is a single instance of data within a record and is based on a field definition. which you should use when declaring your variables (Rowset objects should be declared as type Rowset. and so on.

Local Rowset &rs. Eg: Local Rowset &rs. instantiated from the Row class. or &rec=Getrow( ). A row may have one to n child rowsets. Activerowcount returns the number of active non deleted rows in the rowset. A single row in a component scroll is a row. Totalrowcount returns the total number of rows including the deleted rows in the rowset. is a single row of data that consists of one to n records of data.CopyTo(GetRow(&I)). Createrowset( ) : Methods Activerowcount and Totalrowcount These methods are used to loop through the rows of a rowset. To access a particular row in a rowset use« Getrow (n) --n stands for the row number you want to access. Getlevel0 This function creates an object that corresponds to level 0 of the component buffer. &rs=Getlevel0( ).Getrecord(Record.GetRow(1). Local Row &ROW.it takes no parameters but has a default method GetRow. Instantiating an object This can be done using the following methods Getrowset( ) : This method creates a rowset object in the current context i. &ROW.Recordname).Activerowcount Statement 1 . GetRow returns a row object that references the current row in the component buffers.GetRowset(Record.Recordname. Note: here the object data type is same as the class name. GetRecord([Record.e.Recordname). Methods CopyTo (row) This method copies from the row executing the method to the target row. the records and field references created by this function are initialized to null values. The parameter µrow¶ is a row object and not a row number.ActiveRowCount &ROW = GetRowset(Record. Statement 2 .Rowset class: A Rowset object instantiated from a rowset class is a collection of rows associated with the buffer data Creating a Rowset object: Syntax <Scope> <object data type> <object name> Local rowset &rs.Recordname).Recordname]) With no parameters this method returns a record object for the current concept. . A row object is always associated with a rowset object. you cannot instantiate a row object without first either explicitly or implicitly instantiating a Rowset object. it is populated with data according to the context in which it was instantiated. &rs=GetRowset (Record. that is.. This method creates a stand alone rowset i. For &I = 1 to &RS1. The rowset can be later populated using the fill. &RS1 = GetRowset().e. For &I = 1 to &rs. Creating a Row object: Syntax <Scope> <object data type> <object name> Local Row &row. Row class: Instantiating an object &row = Getrow( ). Local Rowset &RS1. If a parameter is given the record specified should be present in the current row. Or &rec=Getrow( ). A row object. Note: &rec is a Record object &rec=GetRecord( ). CopyTo or FillAppend methods.Recordname) This function returns the first row of the level 0 Rowset of the record.GetRow(&I). End-For. End-For.

Record class A record object. Instantiating an Object This can be done using the following methods GetRecord( ) If a record object is instantiated using this method. instantiated from the Record class. Blank characters correspond to a space on the database.selectbykey( ). use the corresponding PeopleCode record object method. Methods SQLExec The SQLExec function executes a SQL command from within a PeopleCode program by passing a SQL command string.fieldname. All other methods and properties are of the component buffer. the field value is initialized null values. CreateRecord( ) If this method is used for instantiation. The field values are then fetched from the database SQL table into the record object executing the method.Fieldname) This method assigns default values to a field. CreateRecord CreateRowset FlushBulkInserts GetField GetLevel0 GetRecord GetRow GetRowset . Blank dates and long characters correspond to NULL on the database. SelectByKey( ) The SelectByKey method uses the key field names of the record and their values to build and execute a Select SQL statement.fieldname the current field executing the PeopleCode is returned. If you want to delete. and is based on a field definition.value /* fieldname is the key field*/ &rec.value/*other fields in the record*/ &Rec.fieldname. Syntax <scope> <object data type><object name> Creating a Record Object Local Record &rec. and the Select statement is closed. the record object is a freestanding object and all its values are initialized to null values. &Rec. is a single instance of data within a record object. from the row containing the currently executing program. that is.Recordname) &Rec. A record object consists of one to n fields. SetDefault gives each field data type its proper value.Fieldname] ) GetField creates a reference to a field object for the current context.Fieldname) This property hides the corresponding field on the page. insert. Example: Local Record &rec. Creating a Field Object Syntax <Scope> <object data type><object name> Local Field &fld. is a single instance of a data within a row and is based on a record definition. Delete( ) « These methods are used to update. If no default value is specified. Hide(Recordname.Insert( ). Data Buffer Access: These are the methods used to access the data buffer. Update( ). A field object. &Rec=CreateRecord(Record.fieldname1. insert and delete values from the database.value=recordname. Insert( ). If you don't specify recordname. Blank numbers correspond to zero on the database. Field class Instantiating an object GetField( [Recordname. Methods SetDefault(Recname. instantiated from the Field class. or update a single record.value=recordname.fieldname1. it references the record from the current row in the data buffers and its associated data.

4 Below line is added in the Appserv. Field. &N2 = 5. What data buffer classes are available in people code? Rowset.KEYWORD . Log-on to Application Designer in the 3-tier mode. each of which holds the same type of data. What is the diff between the Local and the Component Variables in the PeopleCode? Local variable scope is up to that particular program where as the CMPT variable scope is up to the particular Component.WORKING WITH VARIABLES IN PEOPLE CODE Variable Declaration: Local Number &AGE. They cannot be declared as either Global or Component: *JavaObject *Interlink!-. Enter Debug Mode from the Application Designer 3. &AN2. Scope --. 1. Array. Initializing User-Defined Variables in Declarations: Local String &MyString = "New". The maximum depth of a PeopleCode array is 15 dimensions. Local ApiObject &MYTREE. tree structures. 5. Push and unshift are the functions of the array used to add the elements into the array one from the end of the array and one from the beginning.CFG file of FINDM2 [People Code Debugger] Enable Debugging = 1 To confirm that People code debugger is working follow the steps below. Restrictions on Variable Use: The following data types can only be declared as Local.LOCAL => Valid for the life of the PeopleCode program or function in which it's defined. Component. 4. These values are updated as the code runs. a Local Variable dialog box appears.Global. Open any definition that allows People Code and select Debug. What is an ARRAY in people code? What is maximum dimension of an array? Which function inserts values into an array? What is ³pop´? An array is a collection of data storage locations. Once the People Code Debugger mode is activated. Component Rowset &MY_ROWSET. You can then step through each line of code by selecting Debug. File. What are different variables in people code and their Scope? System variables and User defined variables. grid and so on How do you perform PeopleCode Debugging?  First we have to set the Debugger mode by selecting Enter Debugger Mode in Debug menu in the AD.KEYWORD .) *Query classes All other ApiObject data type objects must be declared as Local.GLOBAL => Valid for the entire session. Record. *TransformData *XmlNode The following ApiObject data type objects can be declared as Global: *Session *PSMessages collection *PSMessage *All Tree classes (trees. your application designer session will begin to blink and it also halts program execution. 6. Local Array of Number &AN.KEYWORD . Local Boolean &Compare = True. You must log-on to PIA using the same User ID that you used to log-on to Application Designer in 3-tier mode. When you run the application and the debugger hits the break point. Local Date &MyDate = %Date. this we can do by selecting local. Step (or pressing F8) to execute it.COMPONENT => Valid while any page in the component in which it's defined stays active. You can check the value of the variables you have in the program in the Local Variable dialog box.  Next we have find which variables we need to Debug. What are the ways of Performance Tuning in PeopleCode? Using Object-Oriented programming and Proper programming logic. Local. Pop is a function of array used to select and delete an element from the end of the array. !-. . Toggle Break at Cursor. Setup the breakpoints by placing your cursor on the desired line of code and choose Debug. Global String &OPER_NICKNAME. This is useful because you wouldn't necessarily want to debug all of the People Code programs associated with an application at one time. Enabling People code Debugger in Peoplesoft 8. !-. chart. component or Global variables from the Debug menu. Local Any &SOME_FIELD. Local Number &N1. Sql. 2.  Next we have to set the Breakpoints using Toggle Break at Cursor or Break Point at Start from the menu items of the Debug menu. !-. levels.Note: Interlink objects can be declared as type Global in an Application Engine program. nodes. and so on. Row.

LEVEL1_REC).FIELD1 */ CallAppEngine("MYAPPID". &REC). level2_row. If used from PeopleCode that isn¶t associated with a page. rowselect How to populate data into Grid in online? 11.GetRow(5).System variables? %AsOfDate: %BPName:%ClientDate%Component%Copyright: %Currency: %DateTime: %DbName: %DbServerName: %DbType: 5. 12.level2_recname. /* set the initial value for INIT_VALUES. &lvl2row. (or) GetLevel0 : Syntax: GetLevel0() Description : GetLevel0 creates a rowset object that corresponds to level 0 of the component buffer.FIELD1.GetFieild(Field. and is also called a Standalone rowset. What is the PeopleCode we write in level one to get data in FIELDS? ROWSET_LEVEL0 = GetLevel0(). update) 6. %TimeOut. . &REC = CreateRecord(RECORD.level2recordname. Using Sql class.ie. 13. [RECORD.INIT_VALUES). level1_row. [recordname. Using object oriented Peoplecode and Creating Objects for the rowset. Getrowset Getrowset and Createrowset in people code? ±is used to get rowset for a record in the component buffer. wrapping date/time fields with %DateOut. by Scroll path.GetRow(1). and passes initialization values. If I want to retrieve level2 Scroll data which commands you have used? Get level (0) FetchValue returns the value of a buffer field in a specific row of a scroll level.<level2record>). &ROWSET_LEVEL1 = &ROWSET_LEVEL0. its properties and methods. What is the function to call an app Engine from PeopleCode? The following calls the AE program named MYAPPID. FetchValue(scrollpath.LEVEL2_REC). How to refer a low level row from higher level? How to refer a second level Field value? What is message get function? What s the diff between Message get& Messages get text functions? By specifying the high level row first and then the low level record.<level1 record>. Can you save the component programmatically? Using Dosave and Dosavenow functions. insert.fieldname I the Scroll Path This is used to get the messages from the Message Catalog. %subrec--is used only in Dynamic View SQL where it expands to the columns of a subrecord: %selectall--%SelectAll is shorthand for selecting all fields in the specified record. What are the options for using SQL in people code? SqlExec Record class methods (selectbykey. ]] RECORD. RECORD. 15. 9. delete. GetRowset(Record.<level3 record>).<level3 record>).GetRow(1).GetRowset(SCROLL.GetRow(1).GetRowset(Record. . If I want to retrieve Level2 Scroll data which commands you have Scrollselect.level1_recname. RECORD. Difference between 10.target_recname where scrollname is the same as the scroll level s primary record name. &REC. &lvl_row.Select() Scrollselect() How you can retrieve data from different ScrollAreas. GetRowset(Record.GetRow(1). 8. 7. fetchvalue. it returns the base rowset from the current context 14.Value = "XYZ". GetRecord(Record. Write the syntax to access third level record field using object oriented peoplecode? &fld=Getlevel0()(1).GetRowset(SCROLL.]fieldname) . What is Getlevel 0()? What is the use of %subrec and %selectall functions? Getlevel0 () ---used the get the rowset of the level0. used? How you can retrieve data from different ScrollAreas.level1recordname. &ROWSET_LEVEL2 = &ROWSET_LEVEL1. 6. target_row. Record.where scrollpath is: [RECORD. &Rs.<field name>)) 7. Createrowset²is used to create rowset for a record which in database.

. the RowInit event will run 16 times: once for the level 0 (header information) and then 15 times for each row of data on level 1. BUSINESS_UNIT). End-If. the third ex: can override the settings on the page to hide. then you should set that value in the record definition. Only to set defaults into fields where the logic is too complex to use the record definition. SetSearchDefault(BUSINESS_UNIT). basically checks that certain fields are filled in. you have a hard default that is always to be used.Using PeopleCode Events SearchInit SearchInit event is needed only for records that will be used as search records. &AUTO_NUM). check_auto_num(BUSINESS_UNIT. check_status(BUSINESS_UNIT. this code activates for all rows of data that are loaded into the buffer. RowInit It runs every time a new row of data loads into a page. The second example . but how many rows are loaded into the data buffer that determines how many times this PC category activates. ). End-If. ). unhide. used to set up default values on the search page. If &AUTO_NUM = ³N´ And PO_ID = ³NEXT´ Then Error MsgGet(10200. and is either Completed or Cancelled. ³Business Unit is a required field. The specified PO exists. End-If. you can set the default based on a condition check of some other field or value using code from the FieldDefault event. ³´).TXN_CURRENCY_SRC = ³P´. SetSearchEdit(BUSINESS_UNIT). If &STATUS = ³C´ Or &STATUS = ³X´ Then Error MsgGet(10200. The first example shows. field defaults can be coded. or Ungray (not display-only) fields based on the initialization. then the data is validated for specific conditions. that you can set some values into special fields. Otherwise. 3. FieldDefault In this event. ³%1 is not a Purchasing business unit.EDITTABLE13 = ³ITM_PURCH_FS´. If INSTALLATION.can also set or change the prompts used. End-If. If None(&AUTO_NUM) Then Error MsgGet(10000. If you have a panel with a level 1 that has 15 data rows that load.³MASTER_ITEM_TBL´. If None(BUSINESS_UNIT) Then Error MsgGet(9000.VCHR_PO_STD Then If All(PO_ID) Then VCHR_PANELS_WRK. &STATUS). If an error condition exists. then the code runs a function to get the information and place it in this field. SearchSave Used to validate the search page to make sure all the required fields are filled in. If.PO = ³Y´ Then DERIVED. So it is not how many rows are visible on the page. 1.BUSINESS_UNIT. Gray(SCHED_NBR). used to set up counters or defaults from the operator preferences on the search panel. End-If.´). You need to understand that even though on the page you can see only five rows of data. This section activates code for each level and each data row. PO_ID. an error message is displayed and the search page is not closed. End-If. If they are filled in. This example turns on edits and system defaults for the Business Unit field in the search page. gray (displayonly). Consider the following 3 examples: If %PanelGroup = PANELGROUP.´. by contrast. Gray(BUSINESS_UNIT_RECV). Gray(LINE_NBR). based on some information. 164. This example checks whether the ITM_SETID field is filled in. This business unit is not set up for purchase order auto numbering. For example. For example: If None(ITM_SETID) Then ITM_SETID = GetSetId(³BUSINESS_UNIT´. Finally. Can place code here to do the validation of all the fields that must be filled in. End-If. 34. If the field is not filled in. End-If.

but it shows how you have to be careful when using FieldEdit code for validation using other fields.PO_LINE). Because the user has not entered a value in the next field. An error message.T rue). This meets the logic requirement. Use when U has a button on a panel. is going to fill in data based on some criteria.PO_ID. based on their settings. Else check_schedules(). PO_HDR. and neither is allowed to have a 0 value.ITM_STATUS = ³A´ Then If PRICE_DT_TYPE = ³P´ And QTY_TYPE = ³L´ Then check_line(). is un-hidden (now visible on the panel). UnhideScroll(RECORD. FieldEdit To validate information within a field. the user must stop and fix the problem. The user enters Red into the first field and tabs out to the next field.RECORD. With a warning message. In this example. 76. The validation code should be placed in the Field Edit event of the brightness field. ³Vendor %1 is not set up for item %2. &WHERE = ³where BUSINESS_UNIT = :1 and PO_ID = :2 and LINE_NBR >= :3´. Because you¶ve allowed only red and blue. the best solution is to change the location where the validation code is placed. LINES_SAVED = ³N´. UnGray(GOTO_LINE_DTLS). If you have validations for which you do not want to leave the field before a specific criteria or process is complete. but if you understand the FieldEdit process. Now red can have a brightness only between 1 and 5. check_item(). A message can contain a lot of useful information. Finally. The first field can be set to a value of Red or Blue only.The following example shows how to use the FieldEdit to do complex validation with an error message. Event gives you the ability to validate using multiple fields and conditions.: jump to another panel. A warning means that the value in this field is not normal. Here you can do very complex validation upon the field. and the other when a button is pressed. . This is what makes button actions so powerful²they can perform all sorts of actions. assume that you have two fields on a panel.PO_LINE.PO_LINE. runs a different function.RECORD. the code does not execute unless there is a net change (changing the value of a field to it¶s original value is not a net change) and the user moves out of the field or saves the page.VENDOR_ID. and verifications. SEL_LINE_FLG = ³Y´. the value is initialized as 0.BUSINESS_UNIT. You should make sure that all decisions to error or warn are well documented in the technical documentation for your modification. whereas blue can have a brightness between 3 and 9.PO_LINE). For the field change event. the first field).&WHERE.´. If All(LINE_NBR_TO) Then &WHERE = &WHERE | ³and LINE_NBR <= :4´. and the data buffer is emptied for this scroll (scroll flush). then the value of the next field must be between 1 and 5. ScrollFlush(RECORD. the scroll¶s data buffer is filled with data based on a selection criterion. Therefore. this is discussed in Chapter 14 in the ³Message and Display Functions´ section. U are not limited to using only the field from which the code is launched. then the value of the second field must be between 1 and 5. but rather can access any field on the page. End-If.FieldChange Occurs under two circumstances: once when a field is changed. This example checks the values in a couple of fields and then. You have to understand the capabilities of the system and how the rules will be applied. or it could be moved to the SaveEdit event (about which you have not learned yet). does not offer the user a choice. End-If. issue an error message to the user stating the problem and do not allow the process to continue until it is resolved.PO_HDR. or run a process. If None(PO_HDR. Place ? Validation that you want to occur within the page field entry process.PO_HDR. This example is from a button which. To apply messages from PeopleCode that will not crash the panel. when pressed.LINE_NBR_TO. to warn or stop the process within the page. The scroll. then you need to place code in FieldEdit. INV_ITEM_ID). If a problem occurs.LINE_NBR_FROM. The second field can be set to a number that represents the brightness of the color (that is. the user can decide to stop and fix the issue or move on and ignore the message. End-if. you will see how this will get you into trouble. on level 1 in the panel. The PeopleSoft Panel Processor then runs the FieldEdit code for the field that states that if the value is red (which is what the user entered). ScrollSelect(1. The code you place for a button can be just about anything you want. To better explain this potential loop problem. then the user can never leave this field. This is a simple explanation.VENDOR_ID) Then Error MsgGet(10200. controls. on the other hand. So you place FieldEdit code in the first field (the color field) that states that if the value is blue. If VENDOR_ITM_VW1. this FieldEdit code fails and requires the user to input a value that will not fail. A warning message tells the user that they might not want to continue or to use this value in the field. here you would place the code that you wish to activate when the button is pressed. but the user is still allowed to continue. fill in the current panel with data based on some criteria you have set.

as you have learned in Chapter 6. 109. then the code prevents the deletion by issuing an error message. The code here checks a field for a specific status. then the delete process has passed the validation. This enables you to write business logic into functions that many programs can call so that you do not have to write the logic over and over in multiple PeopleCode categories. UpdateValue(LINE_NBR.1 in that you now have the ability to place code in new places. End-Function. UpdateValue(LINE_NBR. By using this event.As you can see. This category can also use the warning and error message commands: An error always fails. pass a message.LN_BALANCE_AMT = MERCHANDISE_AMT. The developer. RowSelect This event is used to filter data loaded into a scroll level. RowInsert In the RowInsert event. This code checks a work record field for a specific status and then updates some fields using information in some other work record fields. End-If. &PCT_UNIT_PRC_TOL).VCHR_BALANCE_AMT. By having more places² pages and components²in which to load PeopleCode. If you failed the validation. you need to remember that you may require the same code in multiple places or categories. If a certain status is set. can control whether a row of data can be deleted by checking for orphaned records or other required validations.&SCHED. when using this code even. This is an advanced technique that will not be covered in this book. you might need to place the same code in the RowInit and RowInsert categories.PCT_UNIT_PRC_TOL. you can create the one function and then call it from the other places. ³You cannot delete a voucher line if the voucher has been posted. from graying (displayonly) and hiding fields to doing complex logic for recalculating a total. If VCHR_PANELS_WRK. This is important to PeopleCode 8. This example shows a function that performs some actions. End-If.when loaded into the page. If VOUCHER. Most developers who want to restrict rows of data create a view to use on the page with the restriction in the SQL where clause. a warning reports an issue to the user. Due to this added complexity. The process done here can be just about anything you think of. This is another reason for looking at code that you could place into functions so that you do not end up copying the same code into multiple categories. Note . is validated through the RowInit event. . Writing more functions that you place into this event will save you time and effort in the long run. If the status is not set. The RowInsert can and should perform the up-front validations that you would have placed in RowInit for new data rows being added.FULL_SET_FLG = ³Y´ Then MERCHANDISE_AMT = VCHR_PANELS_WRK.&SCHED. &LINE. you will need to think more in terms of functions when writing code. &LINE. you can apply this restriction as you need to or you can even change the criteria as the page is being created.PO_LINE_SHIP.UNIT_PRC_TOL. The process to show the pass or fail of the event is just like in the FieldEdit event. thereby having your logic in only one place. there is no RowInit to activate because it was not initiated into the panel.POST_STATUS_AP = ³P´ Then Error MsgGet(7030. This delete can be on any level. If you do not issue any messages. RowDelete This event is used to activate code when a delete is performed for a row of data rather than for only a single field. The purpose of this code is to prevent deletes unless a specific criterion has been met.FieldFormula This event is typically reserved for custom-built functions. you apply code to inserts of new data rows. Data. You should not place any code in this category except custom-built functions. &UNIT_PRC_TOL). You have already learned about the flow of how PeopleCode activates from the PeopleSoft Panel Processor and that the process FieldFormula runs for all sorts of actions.´). Consider the following example: Function update_sched() &CHANGED_SCHED = ³N´. A function can take in multiple values and even send back values to the calling program.PO_LINE_SHIP. but when you add a new record (level 0) or a new row of information (level 1 through 3). the code will allow the deletion by not issuing any error or warning message. Instead of copying the code into all these different places and events. VCHR_PANELS_WRK.

&SETID. You must be sure that the record you are going to update or insert is not anywhere within the component. even though the SQLexec came from your process. then the user is unable to save the panel. the processor sees this as another user) has made a change. You have to be aware that using SQL direct statements can lead you into trouble. you will have to add it to SaveEdit to be sure that the code does run.DESCR. If any field of the record is on the component. the status is set to inactive so that you do not use them again.´.³VENDOR´. This code loops through all the rows of a level 1 panel and updates a value in a lower-level scroll (level 2). This is used for the final validation of the record. End-If This code checks some values in the fields and then. VOUCHER_LINE_NUM). the PeopleCode runs and does all its SaveEdit checks and then just prior to saving the information to the database. SavePostChange In the SavePostChange event. so you can place the overall validation in this event instead. no message means that you have passed the SaveEdit validation.´. is used mostly to update hidden fields that need to be changed or corrected based on user input just prior to saving. SavePreChange In the SavePreChange event. DESCR). Usually. but you might want the user to do all the input they can and then do a check just prior to the save. It is not until you save the record that the database is updated. you place code that validates on a save. This will be explained further in Chapter 14. 49. In your page. This event enables you to do other processes and update other rows of data. here is where you would make the code work. BUSINESS_UNIT. SQLexec function calls enable you to run a SQL statement directly so that you can update a related field that is not within the page. After you use them on a PO. The SavePreChange event. This error message is telling you that something happened to the data between the time you retrieved the data and the time you saved it. you can prevent or just warn on a save when the validation is incorrect. You might also have to validate multiple fields as a unit. you add code that you want to activate after the rows of data have been saved to the database. you are making changes. Of course. The PeopleSoft Panel Processor then tries to commit the rest of your changes and sees that someone else (yes. ³´). this event occurs. ³You must enter either a merchandise amount on Voucher Line %1 when distributing by amount. If you warn.VENDOR_PERSISTENCE = ³O´ Then &SETID = GetSetId(³BUSINESS_UNIT´. So be extra careful when using SQL calls within the events. This is your last chance to make changes. If you still need this validation. .SaveEdit In the SaveEdit event. If %Mode = ³A´ and VENDOR. Else If None(MERCHANDISE_AMT) Then Error MsgGet(7030. Once the save is started. If you prevent. 49. This code example shows that if the page is in Add mode and the vendor is set to a special persistence. You do not do updates within SaveEdit. if certain conditions exist. Or you can delete the line. End-For. Or you can delete the line. but these changes are loaded only into your panel buffers. SQLExec(³Update ps_vendor set VENDOR_STATUS = µI¶ where setid = :1 and vendor_id = :2´. A final use for the SaveEdit event occurs when the user does not tab through every field so the FieldEdit code never activates. you can place code to change or update the data tables prior to the save being committed to the database. then the user can stop the save process and edit the problem or they can continue. This process is used on vendors that are set to one time use only. then the vendor status must be set back to inactive so that no further POs can be used. Many developers will place SQLexec function (SQLexec functions will be fully explained in Chapter 14 in the section ³SQL Functions´ calls in this category. This enables you to put code in one place. as this is only supposed to be looking for errors. The process is the same regardless of whether you¶re using warning or error messages. For &BUFFER_ROW = 1 To &CURRENT_ROW UpdateValue(VOUCHER_ID. End-If. preventing the save of this panel.VENDOR_ID) End-If.&BUFFER_ROW. It is hard to do this within FieldEdit. an error message is issued. VOUCHER_LINE_NUM). you can do a lot of this validation in the FieldEdit event. This is also where a lot of SQL execs are written and performed to update other necessary fields.DISTRIB_LINE. so your panel is not allowed to save. CurrentRowNumber(). Code placed here could be line totals and other calculated fields. If you need to total a field in level 1 and place the information in a header record (level 0). If DISTRIB_MTHD_FLG = ³Q´ And None(QTY_VCHR) Then Error MsgGet(7030. Someone else grabbed the information and changed it prior to your change committing it to the database. then you will receive an error: This panel has been updated by another user. As with the other edit events. ³You must enter either a quantity on Voucher Line %1 when distributing by quantity. You can see in this example how you are updating the vendor based on an action in the PO system. assuming that the process will complete. The problem occurred because of your SQLexec²it ran and made an update to the database. since you do not want to update the header level field with every row insert or field change on the level 1. and it runs doing the work just prior to the save.

AVERAGE. If IsUserInRole ("TEST ROLE1") Then GR_STUDENT_DWR. To make some fields Invisible in a particular page to particular user. "Message not found. If IsUserInRole ("GDHAR") Then GR_STUDENT_REC. End-If.SCIENCE.STUDENT_NAME.GetRowset (Scroll. 411.SOCIAL.SUPERVISOR_ID) Then &Temp = MessageBox (1. /* set the initial value for INIT_VALUES.PO_LINE. GR_STUDENT_REC.TELUGU. . 4.HINIDI. "Message not found. &RSLevel1 = &RSLevel0 (1). ScrollSelect (1.FIELD1 */ CallAppEngine ("MYAPPID".DisplayOnly = True. &REC).DisplayOnly = True. If None (HR_MGR_REP_DAT. UnGray (GOTO_LINE_DTLS).VENDOR_PERSISTENCE = "O" Then &SETID = GetSetId ("BUSINESS_UNIT".HR_REPORT_TRANS).HR_MGR_REP_DAT. ""). LINE_NBR_FROM. GR_STUDENT_REC.BUSINESS_UNIT. &Warning = "N". SEL_LINE_FLG = "Y". if there are more than one user. 1. End-If.DisplayOnly = True. FieldChange : If VENDOR_ITM_VW1.EMPLID.ENGLISH. LINES_SAVED = "N". End-If. BUSINESS_UNIT.GRADE. PO_HDR. "".DisplayOnly = True. VENDOR_ID). GR_STUDENT_REC. &WHERE. Local Rowset &RS Level1. To make some fields Display only (read only) in a particular page to particular user. If All (LINE_NBR_TO) Then &WHERE = &WHERE | " and LINE_NBR <=:4".DisplayOnly = True.FIELD1. 860.").").INIT_VALUES). 6605. GR_STUDENT_REC.Visible = False. &SETID.Value = &RSLevel0 (1). GR_STUDENT_DWR.PO_LINE).Value = "XYZ". PO_HDR. &Warning = "Y". &Temp = 0.PO_LINE). if there are more than one user. SQLExec ("Update PS_VENDOR set VENDOR_STATUS = 'I' where SetID =:1 and VENDOR_ID =:2". Else check_schedules (). Break When = 2 /* do nothing */ End-Evaluate. 1120.PO_ID.DisplayOnly = True. GR_STUDENT_DWR.PEOPLE CODE PROGRAMS . LINE_NBR_TO. 2. End-If. "". Call AE: &REC = CreateRecord (RECORD.MATHS.Value Then End-If. &REC. &WHERE = "where BUSINESS_UNIT =:1 and PO_ID =:2 and LINE_NBR >=:3". 3. If &RSLevel1 (&I).HR_REPORT_TRANS. RECORD. Save post change If %Mode = "A" and VENDOR. ScrollFlush (RECORD. Local number &Temp. RECORD. GR_STUDENT_REC. UnhideScroll (RECORD. GR_STUDENT_REC. For &I = 1 to &RSLevel1. End-If.Visible = False. Local Rowset &RS Level0.Visible = False. End-If.PO_LINE. "VENDOR". &RSLevel0 = GetLevel0 ().TOTAL. If &Warning = "Y" Then &Temp = MessageBox (1.ITM_STATUS = "A" Then If PRICE_DT_TYPE = "P" And QTY_TYPE = "L" Then check_line (). End-For.DisplayOnly = True. Evaluate &Temp When = 0 When = 1 DoSave (). End-If. True).SUPERVISOR_ID.ActiveRowCount.

&GRIDCOLUMN.LEVEL1_REC).DERIVED_HR.ActiveRowCount.FLSA_STATUS.GetColumn("EDIT"). End-If. &SalRange(&I).C_WOTC. if I want to retrieve level2 Scroll data which commands you have used? Scrollselect.USE.OPRROWS_SEARCH. For &J = 1 To &Xlat. End-For.GetRow(&J).UNIT_PRC_TOL. Page. End-If.Value. How to refer a low level row from higher level? By specifying the high level row first and then the low level record. Populate action reason dropdown &SalRange(&I).DERIVED_HR. &LINE.GetRowset (SCROLL.Label = MsgGetText(18032.GetColumn("CONTACT"). PO_LINE_SHIP. &LINE. &Xlat = CreateRowset(Record.ACTION AND ACTION_REASON = A.ACTION_REASON_SS.ACTION = 'PAY' AND A.DESCR FROM PS_ACTN_REASON_TBL A WHERE A.EFFDT = (SELECT MAX(EFFDT) FROM PS_ACTN_REASON_TBL WHERE ACTION = A. BarName. MenuName. &GridRs = GetLevel0()(1). &CodeIn. &SCHED.OPRROWS_SEARCH. it returns the base Rowset from the current context.AddDropDownItem(&CodeIn. &SCHED.OPTION_VALUE_1.Label = MsgGetText(18032. "Message Not Found"). rowselect 8. Using object oriented Peoplecode and Creating Objects for the Rowset. Adding required field cue to field C_WOTC If %Component = Component. "EMERGENCY_CNTCT").ACTION_REASON_SS. &DescIn).YEAR.GetRow (5). &GRIDCOLUMN = &GRID.ROLE_MANAGER. 13. by Scroll path. (Or)GetLevel0: Syntax: GetLevel0 () Description: GetLevel0 creates a Rowset object that corresponds to level 0 of the component buffer. How you can retrieve data from different ScrollAreas.ShowRequiredFieldCue = True.FieldFormula Function update_sched () &CHANGED_SCHED = "N". &PCT_UNIT_PRC_TOL).Fill("WHERE CONFIG_ID = 'STPMSS_PAY_ACTREASON' AND CONFIG_VALUE = 'USA'"). PO_LINE_SHIP. Hide Grid (All Rows) Local Rowset &GridRs. Update Value (LINE_NBR. fetchvalue. If used from PCode that isn t associated with a page.GetColumn("RELATIONSHIP"). "U"). &lvl_row. If &REG_REGION = "USA" And &FLSA_STATUS = "N" Then PER_ORG_ASGN. &CodeIn = &Xlat.HideAllRows(). Make thstBirthDate field is Readonly DERIVED_STP. RECORD.ie. &Xlat.Label = " ".HR_EMERGENCY_CNTCT.ACTION_REASON = :1 AND A.ACTION_REASON)".level1recordname. How to refer a second level Field value? RECORD. &GRIDCOLUMN. 5. &DescIn).REG_REGION. Record.fieldname I the Scroll Path 9. &MostCurrent).BENEF_ASOF). End-Function.level2recordname. &GRIDCOLUMN = &GRID. ItemName. &ROWSET_LEVEL1 = &ROWSET_LEVEL0.Label = " ". In level 1 to GET data in fields? Sol: ROWSET_LEVEL0 = GetLevel0 ().DisplayOnly = True Set the grid column label. 14.PCT_UNIT_PRC_TOL. "Message Not Found"). &GRIDCOLUMN = &GRID. &GridRs. SQLExec ("SELECT A. &ROWSET_LEVEL2 = &ROWSET_LEVEL1.LEVEL2_REC). &FLSA_STATUS = FetchValue(JOB. &GRIDCOLUMN. .GetRowset(Scroll. This needs to be done because when you set the values for the hyperlink.ClearDropDownList().GetRecord(1).GetRowset (SCROLL. Update Value (LINE_NBR. the grid column heading also gets changed &GRID = GetGrid(Panel.JOB_DATA Then &REG_REGION = FetchValue(JOB. UNIT_PRC_TOL). This line code tranfers the manager to the search page Transfer ( False.STP_CONFIG_DTL).GetColumn("DELETE"). &MostCurrent). &lvl2row. &GRIDCOLUMN2. &GRIDCOLUMN2 = &GRID.GetRow (1).

&COMPETENCIES = &REVIEW(CurrentRowNumber(1)). &Row0 = &Rowset0(1). HideAllRows hides all rows of the rowset. Populate data into scroll area with condition Evaluate %Component When = Component.DESCR = &RESPONSE. &Rowset0 = GetLevel0(). data that you don¶t want.EMAIL_ADDRESSES. DERIVED_HINT.flush(). If you notice.EMAIL_PSWD2.GetRowset(Scroll. user wants to hide and unhide the grid from the page by selecting the check box option on the page. &HINT. &EVALUATION_ID. End-If. here are the simple steps to do just that. &REVIEW_DT). Next we will want to instantiate the object. &EMPLID. DERIVED_HINT. Lets say we have a Grid on a page and the main record on the grid is called COMPETENCIES. OR 2) Delete the data from the grid &Rowset0 = GetLevel0().OPRID.1). I want to remove all rows of data from the Grid.1 &Rowset1. Scroll.ShowAllRows(). &Row0. &Rowset1.GetRowset(Scroll. End-Evaluate. And.PERSONAL_PHONE). Once that is complete. &Rowset1 = &Row0. Record.HR_EE_PERS_INFO ScrollFlush(Scroll.). I am defining the Grid object as a Rowset. 1) Hide the grid.EMPLID).EMAIL_ADDRESSES. PERSON_PHONE.GetRowset(Scroll. ScrollSelect (1.).GetRowset(Scroll. Function HideAllRows() can be used to hide the grid.PERSONAL_PHONE.). ScrollFlush (Scroll.ActiveRowCount To 1 Step . &COMPETENCIES. End-For.Populate The Secondary page using peoplecode (fieldchange) If %Menu <> "STP_HR_SELFSERV_ISSC" Then SQLExec ("SELECT HINT_QUESTION. The code for this would look as follows: Local Rowset &COMPETENCIES.EMAIL_ADDRESSES). . For the given example. WHERE EMPLID = :1 AND EVALUATION_ID = :2 AND COMPETENCY IN &IN AND EFFDT = %DATEIN(:3) . If the check box is checked the grid should be visible else hide the grid & delete the values present in the grid. Instantiate just means to represent by an instance.Flush(). &Rowset0 = GetLevel0().). "WHERE EMPLID = :1 AND E_ADDR_TYPE <> 'LAN'". "WHERE EMPLID = :1 AND PHONE_TYPE <> 'MAIN'". &Row0 = &Rowset0(1). Scroll. DERIVED_HINT. Manipulating Data on a Grid: Scroll Peoplecode When you have a grid that is filled with data. then use function flush() to delete the data from the buffer.PERSONAL_PHONE. 3) Unhide the grid &Rowset0 = GetLevel0(). Well we would first want to define a Rowset object to manipulate. How do you clear it out and then fill it with the data set that you do want? Well. write the below people code at field change of check box. &Row0 = &Rowset0(1).COMPETENCIES).Select(Record. PERSON_NPC_VW. DoModal (Panel.EMPLID). using the GetRowSet function. &COMPETENCIES.DeleteRow(&i). &Rowset1 = &Row0. Record.HINT_QUESTION = &HINT.1. I am getting the Rowset from the current grid called competencies.HideAllRows(). "". Now lets fill the grid with new data that we really want. . &Rowset1. & function ShowAllRows() can be used to unhide the grid. For &i = &Rowset1. . I am not creating a new Rowset. &Rowset1 = &Rowset1. If the data is present in the component buffer & not present in the data base. To do that I simply use the Flush method. ScrollSelect (1. &Row0 = &Rowset0(1).GetRowset(Scroll. How to hide & unhide the grid from the page by using people code? In the given example.COMPETENCIES. &RESPONSE). &Rowset1 = &Row0. HINT_RESPONSE FROM PSUSERATTR WHERE OPRID = :1".The check box is at level 0 & the grid is at level 1.

This cuts down on the number of round trips to the database. The following is an example using a SQL object for doing an insert: &SQL = CreateSQL ("%INSERT(:1)").Value = &I. A number that should appear as a first column in the input file to identify that it contains the data for its corresponding record. Define the file layout with the child record as sub-segment. 000 File record id Contains the data for the other record.GREG). &SQL. &REC = CreateRecord(Record. or create a SQL Insert statement using the SQL object. so People Tools only looks for the meta-SQL once.Value = &I.0 P Y 888 A 000 8001 VAC 1983-03-02 1983-03-07 5 . this can mean better performance.What I am doing in the above line of code is selecting the data that I want to use to fill the grid. &REC. 888 File record id .0 P Y 888 A 000 8001 VAC 1983-08-26 1983-09-10 13 .DESCR.Execute (&REC).BulkMode = True.DESCR. bulk insert. Inserting rows into record using Peoplecode with better performance When inserting rows using People code.EMPLID. 888 A 000 8001 VAC 1981-09-12 1981-09-26 14 . &REC. File layouts for inserting data into parent-child records. If you're doing a single insert. Sample file layout structure. use the Record Insert method If you're in a loop.Value = "Y" &I. you can either use the Insert method with a record object. &REC. Since we have more than one record.Value = "Y" &I. By selecting the record I am in essence asking to select all the fields that are on the grid from the COMPETENCIES table with the where clause. A dedicated cursor means that the SQL only gets compiled once on the database. The following is an example of using the record insert method: &REC = CreateRecord (Record.0 P Y 888 A 000 8516 MAT 1986-06-06 1986-08-01 56 .Insert(). &SQL.GREG). In File layout segment properties define the file record id. This can mean better performance.EMPLID. For &I = 1 to 10 &REC.0 P Y . For bulk insert. we need to set this file record id for the both records / segments. &REC. inserted rows are buffered and only sent to the database server when the buffer is full or a COMMIT occurs. and therefore calling the insert more than once. Again. (File layouts for inserting data in to multiple records). use the SQL object. Why? Because the SQL object uses dedicated cursors and if the database you're working with supports it.This record contains only one field and its value is A.

data uploading/downloading etc. including allocation and population of memory arrays created by the Load-Lookup and Array commands.. 3.SPF extension). How you can see the SQR Errors (after Execution)? SQR normally places the SQR PROG output files in the directory from which you run the PROG. ex1a. you can easily view the sample PROG¶s .SPF´=This is a Portable format file. If you specified the -KEEP argument. Begin-SQL paragraph.ERR.. Work buffers are allocated. All #commands are evaluated. Optimization of the SQL data access path is determined. Where the Programming logic is more.). one output file is in SQR Portable Format (recognizable by its . File Interfacing.Lis´=This is Line Printer Output file. If We need to generate different kinds of reports.spf(sqr portable format) What are the sections and paragraphs available? There are five sections and three paragraphs available in SQR programming. Begin-program/Report End-program. ³. Begin-procedure End-procedure. The SQR Viewer is invoked from the command line with ³sqrwv´. Begin-heading End-heading. The output files should appear as soon as your PROG has finished running. We To produce the desired output file for this exercise. File types in SQR? 1. BEGIN-SQL can have any number of DML statements & it can also have PL.lis or .SQR´=This is nothing but the SQR source file. Begin-footing End-footing And the paragraphs include: Begin-select paragraph. but the file extension is different. 2.SPF file output.LOG.What is SQR used for? It is a Reporting Tool for creating customised reports to be run from PeopleSoft panels for formatting reports. the -KEEP flag is used in our example. ³. 7.INI´=These files are used to set the default Environment for our SQR Report. 4. explain the -KEEP flag later in this guide. 3. on Windows platforms with the SQR Viewer GUI (sometimes referred to as an ³SPF viewer"). Background SQL processing. ³. ³. ³. ³. 8.DAT´=These are used for Error Handling purpose. Execution Stage Processes data for the Body section Processes HEADING section Processes FOOTING section Writes entire page buffer to file. What is a difference between Begin-Select & Begin-SQL? BEGIN-SELECT has only one SQL statement. ³. Default output file is . The #DEFINE text substitution variables are placed into the program source. Syntax of SQR source program is checked.spf. The SETUP section is processed. 2. The sections include Begin-setup End-setup. data transfer. SQR Portable Format is discussed later in this guide but for now.MAX´=These are used to increase the memory size. Where and when do we use SQR? 1.SQL statements for oracle & each statement should end with double semi colon (. 5.SQT´=This is Complied time file. 4.lis If u specify -keep the output file will be in . The output file has the same file name as the SQR file that created it. 6.SQC´=This is a used as functional Libraries. Etc« Processing sequence of SQR Compile Stage All #Include external source file (SQCs) are inserted into the source. ³. . Begin-document paragraph What is the only required section of a SQR Program? The only required section of SQR program is BEGIN-PROGRAM with its corresponding END-PROGRAM..

--RS & --Rt Flags? --Bnn for specifying default number rows -S.-A. What is the SQT file? What are the advantages of SQT files? SQT file is nothing but resultant file after the compilation (i.lis -Flisting.-RS.LIS files by using the SQR printer.sets query buffer size. use the -F command line flag for multiple reports? Let s look at the following example.e.lis.--Tnn. -T6. we want to test. What is the difference between . it will stops the program after six pages of output have been created. --RT is used to run . The program "ex20a. What is the value used with -C flag of BEGIN-SELECT? BEGIN-SELECT -Cflag (Oracle. sqr ex20a tutorial/secret -Flabel.SPF files? Lis files are printer specific output report files.lis Which types of command line flags are useful for creating the .-RT etc« to retrieve from the database. stopping the program after the comilation. e-mail. List Out some Command Line Flags in SQR? What is ±Bnn.LIS and .What is the SPF File? What are the Flags required to make a file to SPF? SPF is a Portable Format File and the command line flag used is ±KEEP. -KEEP.lis -Fletter. we use the ±Tnn command line flag? If we use this flag SQR ignores BEGIN-SELECT ORDER BY clauses. We can restrict the system to generate only a specific number of pages instead of generating all pages for testing. By using this SQT file for Execution we can increase the Performance of the program by reduciong the Compilation Time. What are ±ziv and ±keep command line flags? -keep is the SQR execute command line flag causes SQR to create spf output in addition to .SQT file.SQT file. . SQR for TESTING purpose? -Tnn command line flag.SPF files? -ZIV. . _RT is used to run the SPF file .) Runtime File. And we can also convert back to the . . For example. so that we can view.-Debug. .-KEEP. What are the uses of SQR portable files(spf)? We can create the printer independent output files. -NOLIST. number of pages --Tnn used for Testing Which specifies the --RS is used to create a .-O.sqr" creates 3 reports. How can I suppress display of the SQR banner line when running SQR Use the -XB flag. Ingress.-ZIV. -RS & -RT Flags? RS is used to generate SPF file ie. 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.This is also one kind of Performance increasing technique by saving the compilation time.spf files can be viewed and printed by the SQR viewer and also can be emailed.-XMB.spf we can create printer independent output files. SQL Base) .-ZMF. -Tnn flag? This is mainly used for testing purpose. Can a . -ziv is used for invoking spf viewer after generation SQR output files.sqt file be "de-compiled" into the original SQR code? No. This is used in Windows Environment.-E. This is not possible. fax and print these files by using the SQR Viewer.lis files are not convinient for viewing the file before printing or to email.

Using Show or Display command. Display is used to display only one variable at a time. .lis In the above example.sets query buffer size. What are the commands SQR supports for Conditional Debugging purpose? 1. any number over 256 is in bytes only.ora file . #debug 2. no err file is created.s01 listing. What is the use of the ±E[file] command line flag? We can save the error messages by specifying a file name. what are the debugging commands in sqr? Show & Display are debugging commands Show is used to display more than one variable at a time. What is the value used with -C flag of BEGIN-SELECT? : BEGIN-SELECT -Cflag (Oracle. Ingres.lis -Flisting.err. If SQR generates no messages. What are the other command line flags supports the SQR for Testing and Debugging purpose? -C. SHOW What is Debug Command Line Flag? -DEBUGxx. SQL Base) .spf letter. ««««««««««-S. What Commands are used to show Output on Screen of an SQR at runtime ? Display & Show are the commands for that. How to use the -F command line flag for multiple reports ? Lets look at the following example. All these information will be stored into the log file. How do we Debug SQR? By using #Debug.sqr" creates 3 reports. #IF DEBUGxxx #END-IF 2.For Oracle the default is set by the context_area parameter in the init. Example: sqr ex20a tutorial/secret -Flabel.What is the use of the ±Tnn command line flag? We can speed up the testing cycle.the default is 4096. The program "ex20a. #debugx show µx¶ #debugy show µy¶ #debugz show µz¶ #debugz show µa¶ #debugz show µb¶ The output is show µx¶ show µy¶ show µz¶ because #debugxyzab flag was not specified. and ±E[file] What is the use of the ±S command line flag? It will show the status of the program cursors. what would be the names of the SPF files if we use a -keep command line flag ? The names will be: label. What is the use of the ±C command line flag? It creates the Cancel Dialog Box during the program run.lis -Fletter.#ifdeg 6. #ifdef 5. After completion of the program it will display the following information: Text of each SQL statement Number of compiled SQL statements and number of executed SQL statements. How can you Debug SQR programs? We can Debug SQR using Debugging Commands such as 1. Suppose that ±debugxyz is command line flag and the following are debug statements. Default file name is the name of the program with the extension . DISPLAY and 3.#End-if What happens? If we specify like the following: 2.#if 3. If the value of the -C flag is up to 256 it is in kilobytes. or #Ifdef Debugx #endif.s02 How to find out Which SQL is running in SQR? Using -S flag while executing SQR at runtime. Total number of rows selected. #Else 4. And we can stop the execution after getting the specified number of pages for our report output. So that we can cancel the execution of the program when necessary.

ON-ERROR=Procedure_name How will you perform ERROR handling in SQR? We can do Error handling in SQR using some command line flags such as O.dat' as 1 for-reading record=80:vary while 1 read 1 into $record:80 if #end-file break end-if unstring $record by '|' into $field1 $field2 $field3 . show $field1 ' ' $field2 ' ' $field3 . 1.txt as #1 for-writingrecord=93:FIXED If #filestat=0 (file opened successfully) Write #1 FROM $iSalVCode:3 End-If How does SQR provide you the ability to verify that a file was opened successfully? If you assign a numeric variable to the STATUS=in a file OPEN.-ZMF.For-Appending. -L. What is the maximum record length for the OPEN command? The maximum is 32K bytes (32767). What are the commands used in File Handling of sqr? Using File Handling we can Import. How will perform Error-Handling in SQR? Using the command line flags ±O.dat as 1 for-reading record=50:vary Open C:\sqrtemp\vendor2. Ans: Instead of reading a record into individual fields. This is a PC limitation not an SQR limitation. this variable will contain -1. Arguments can be put into a report argument file that is specified with @file on the command line. Writing Data into Table Using BEGIN-SQL paragraph & INSERT command What are Open & Read functions of File Opening in SQR? Open Vendor.Read & Write.. How do you trap Errors in SQR? a) Using BEGIN-SELECT ON-Error=ErrorProcedureName b) In procedure display #SQL-Error to show ErrorNumber &$SQL-Error to display message.. Reading Data From File Using READ command.Close... Example : begin-report open 'test.For-Reading. Opening a File Using OPEN FOR-READING commands.. What are the File Manipulation commands in sqr? Open.What is the limit for SQR command line length on PC/Windows? The limit is 128 characters. you may check the numeric variable after the OPEN. end-while close 1 end-report . read the entire record into one field and then use the SQR unstring command to separate the delimited fields. You may want to have the SQR BINW directory on your PATH so that the full pathname to the SQRW executable is not needed. If the OPEN fails. How can I read in variable length delimited fields from a sequential file? An example format would look like this: field1|field2|field3|.-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).-ZMF and ±XMB Using SQR commands ON-ERROR=Skip/Warn/Stop..For-Writing.-L. Steps are 1.

Using proper programming in our SQR program. update. What PeopleCode must be on all Run Control Records? : On the PRCSRUNCNTL record. Using Bnn Command line Flag.This program reads an ASCII file. Only the selected columns have to be.1)' write #flatfileid from $col2 ' (. Using SQT files and Running on Batch Server. . Note that in SQR Version 3. Using Proper Programming Logic in SQR such as Using BREAK statement in EVALUATE Command. 2. 8.LIS file? Delete the last line in the . Using MULTIPE REPORTS. How to pass Inputs for sqr program while running from windows? Using ASK & INPUT Commands. Using Multiple Reports. Example: begin-procedure main move 'DEPTNO' to $col1 ! You might use INPUT here to prompt the user move 'ENAME' to $col2 ! to enter the column and table names instead. Using SQT Files. This SQR report will actually write another SQR code with column names supplied by the user and execute it. No.Can I use 'dynamic column names' in Begin-Select (versions prior to v3. 5. In BEGIN-SELECT do the FROM and WHERE clause have to be aligned to the left margin How do you control the number of iterations or fetch records firing SQL statement in SQR. What restricts the size of LOAD-LOOKUP memory arrays? : Available memory.sqr' to $sqrpgmnam let $syscmd = 'sqr '||$sqrpgmnam||' user/password' move 100 to #flatfileid open $sqrpgmnam as #flatfileid for-writing record=132 write #flatfileid from 'BEGIN-REPORT' write #flatfileid from ' DO MAIN' write #flatfileid from 'END-REPORT' write #flatfileid from 'BEGIN-PROCEDURE MAIN' write #flatfileid from 'BEGIN-SELECT' write #flatfileid from $col1 ' (+1. Using Proper SQL in our SQR program. How can I prevent the printing of the empty page at the end of every . 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). 7. Using LOADE-LOOKUP & LOOKUP. Using ARRAYS.LIS file through an editor or this can be automated with CALL SYSTEM USING command which would execute the following SQR code. 6. move 'EMP' to $tab move 'sqrout. Using Command line flags such as ±bnn & -s.30)' write #flatfileid from 'from ' $tab write #flatfileid from 'END-SELECT' write #flatfileid from 'END-PROCEDURE MAIN' close #flatfileid call system using $syscmd #status display 'Status of call is ' noline display #status end-procedure How can I find out if rows are selected by a BEGIN-SELECT paragraph? Can I use the SQR variable #sql-count? #sql-count indicates the number of rows affected by a DML statement (insert. 4. The solution is here below: begin-procedure main1 move 0 to #count ! This is optional unless main1 is called more than once begin-select column1 column2 column3 add 1 to #count from table1 end-select if #count > 0 show 'Number of rows selected was ' #count edit 999 else show 'No rows selected' end-if end-procedure main1 : By using Begin-Select Loops=<number> statement. What are the steps in performance tuning? Using Loadlookup & Arrays. dynamic columns are directly supported. It cannot be used for a BEGIN-SELECT paragraph. or delete). removes the last line (the line having the Form Feed) from it and writes the output to another ASCII file. see following workaround. Running on BATCH SERVER. Proper SQL tuning such as using Sub queries instead of Joins.0. How many ways of performance tuning are there in SQR? 1. 3.0)? Yes. the RowInit on OPRID and the SaveEdit on RUN_CNTL_ID.

It is used to take an input at compile time. literals.EffDt AND B. ³INPUT´ 1. Operators in the expression can be arithmetic. How do we work on Effective dated rows on SQR? Write a subquery to get current effective date & then write an outer query for matching effective dated rows from a record. This prompts for the values during the Execution Time.Making the SQR program API aware by calling two procedures (stdapi-init. . Creating new run control SQC if we create a new run control table.Three steps we have to fallow to run the SQR program from the peoplesoft environment (Process Scheduler). And command line arguments are application specific input parameters that are retrieved by the program from the command line using the input and ask command. This does not have the data type and length. Input command is used to accept user input at runtime. operators. stdapi-term) from the Begin-program section and including the Stdapi. Operands in the expression can be SQR columns.EffDt) from Table1 B where A.EffDt=C. component and register the component.EffDt<= as of Date) Select * from Table1 A where A.keys B.e.keys AND B.EffDt<= as of Date) AND B. . or array fields.EffDt from Table1 B where A. string or relational.Giving the permission to the user by giving process groups.EffDt= (Select Max (B. 2.keys B.EffDt= ( (B. . 3.keys AND A. What is a difference between Ask & Input command ? Ask is a compile time substitute variable which is defined in Begin-Setup. we can specify the data type and the length. What is the difference between Command line flag arguments and command line arguments? Command line flag arguments are simple parameters related to each specific flag.EffSeq).sqc in the bottom of the program. Here. For ex: you want to accept a printer from user at compile time. and functions. Effdt and EffSeq Quries? Select * from Table1 A where A.keys=C. . Compile Time Variable.keys AND A. These steps include .Use of the MOVE Command? It moves the data from on field to another field and it can also perform data conversions and data editing using special edit masks.EffSeq from Table1 C where B.EffSeq=(Select Max(C. What are the steps required to run the SQR from peoplesoft environment? .Create new run control table or using existing run control table and creating run control page. Diff between ASK & INPUT Commands? ´ASK´: 1. This prompts for the values during the compilation time.EffSeq=C. Run time Variable 3. What is the difference between Move and Let command? Move command is used for data conversions where as let command used for data conversations as well as logical expressions and calculations. 2.e. This can be used in other than the Setup section i. What is Let command? A single Let command is capable of replacing a no of data manipulations and logic commands What is the syntax of the LET Command? LET target_variable = expression Expression can be combination of operands. it can handle data of any format except date to numeric vice versa. This is used in the Setup section i.

Can you call procedure in oracle from Sqr? How? To call a database procedure using Begin-select paragraph. How do you link SQR reports to process scheduler? Create/modify/add run control table if you have any new fields Create/modify/add run control page if you have any program inputs Create a menu definition (Note Menu group name: XYZ) . b) This panel includes PRCSRUNCNTRL table & RUNCNTRL table having OperatorID & RunCntlID. by displaying a list of currently logged requests waiting to be processed. . Execute this procedure in else part of If $prcs_process_instance = which means that this sqr is to be executed from Process Scheduler. How to pass command line flags to a sqr report running through process scheduler? .EXE c:\sqrtemp\%1. How do you Execute SQR using Process Scheduler ? - a) Include some RunControl panel having OperatorID & RunCntlID.d) Write PeopleCode OPRID = %OperatorID.max -Oc:\SQRTEMP\sqr.Give operator security Create Process scheduler definition -Use-Process definition ± process definition add Give report name and report type. End-SQL from Dual End-select To call from Begin-sql. How do you run SQR Report from DOS Prompt using a Batch File? - C:\FDM75SU\sqrbinw\SQRW. completed etc . the syntax is as follows: Begin-select Begin-SQL <Procedure name> [(report arguments)] <procedure-name>. From this list you can view the active list of Process Scheduler Servers and stop their execution depending on your level of security.log(LogFile) -Fc:\sqrtemp\%1.Write procedure into SQR code which would have an SQL statement to fetch you fields from RUNCNTL table. the syntax will be Where should you place user prompts for non-Process Scheduler execution? : In the Init-Report procedure.What is Process Scheduler? This is a People tool used to Schedule and monitor the Execution of any Process or Report or Program in PS Environment.ini -lockrl REM -XCB (do not display Communication Box) How SQR identifies where we keep sqr files (Path of SQR files)? It is specified in Configuration Manager. Remark all input fields. in the following code: If $prcs_process_instance= !prompts go here End-If What PeopleSoft tool is used to change the value of your SQR environment variables? : The Configuration Manager. - What is Process Monitor used for? A centralized utility allowing you to monitor the status of process requests that you have submitted.. in RowInit event of OPRID field.Using override options in the process definition in the Process Scheduler in the People Tools.lis(Output File) -ZIFc:\FDM75SU\sqr\Pssqr.From the Field Value of RUNSTATUSDESCR field from PS_PMN_PRCSLIST table. How does peoplesoft Process monitor knows that the process (Say sqr report) is at what stage such as initiated. . in process.sqr EPDMO/SYSADM/SYSADM I c:\FDM75SU\sqr\ <IncludeFile Path> - -Mc:\FDM75SU\sqr\AllMaxes. . c) Add your own input fields to this RunControl record & also drag drop it onto your panel.

ProcessType = "SQR Report".SQR HRMS/PS FC: \TEMP If we want to pass any run time values we should specify «« C:\>SQRW <PROGRAM_NAME> <DATABASE_NAME>/<PASSWORD> <OUTPUT_DIRECTORY> <values> C:\>SQRW SAMPLE.RunLocation = "PSUNX".TimeZone = %ServerTimeZone.SQR HRMS/PS FC: \TEMP µ100¶ How do we run the sqr through peoplecode? This is the code to run the sqr thru PeopleCode. &RQST. &RQST.OutDestFormat = "PDF".RunDateTime = %Datetime.OutDestType = "File". &RQST.ProcessName = "HAPDT009".exe D:\pt848\SQR\infup_file_name. &RQST. &RQST = CreateProcessRequest(). &RQST.sqr -iD:\pt848\SQR\ -xmb -xcb ZIFD:\pt848\SQR\pssqr.ini -S -DEBUGX -PRINTER:PD -EH_PDF -fD:\pt848\output_file_name. If we want to run any program we should specify C:\>SQRW <PROGRAM_NAME> <DATABASE_NAME>/<PASSWORD> <OUTPUT_DIRECTORY> C:\>SQRW SAMPLE.pdf Options: oD:\pt848\log_file_name. &RQST.Status. &RQST.RunControlID = "1".Schedule(). &RQST. . &RQST. &PRCSSTATUS = &RQST.log -i => Input file Directory -f => Output File Name -o => Log file Name -ZIF => SQR Initialization File Name API aware? An API aware process updates the process request (PSPRCSRQST) table with the process run status.Running SQR from Command Line D:\PT848\bin\sqr\DB2\BINW\sqrw.

gives a error if the Exceeds the specified number. $.sqt extension? SQR programs do not require a . The SQR variable $string is equivalent to $STRING.1) EDIT DD/MM/YYYY or use internal function or DateNow for current date & time. Number of rows are not automatically 2. 2. Numbers of rows are automatically added. How to refer a global variable in local procedure? After special character (ex.We can directly print from Load-Lookup. What is a syntax of LoadLookup ? Ans: It is declared in Begin-Setup.We cannot directly print from Array. list only the fields for which a value is known. 3. All other fields will get the null value. When doing the insert.Column Variables. What are the differences between Load lookup and Array ARRAYS LOAD-LOOKUP 1.sqr extension? Do SQR runtime files require a . c) Using an Array or flat file instead of database tables. 80. Do SQR programs require a . How do you differentiate printing a database column & any other variable in a select statement? Database fields should start with the 1st column.We can retrive any number of fields from a table. & used for? #Numeric. What are variable types in SQR? & Data base reference fields ± Read only $ Character (Same for Date) # Numeric { } Variable in ASK or # define [$ variable] Dynamic variable referencing Is there any read-only variable in sqr? Column Variables & System Variables are Read-Only Variables. b) Using LoadLookup command. System Variables. How can I insert a null value into a numeric field in the database ? I tried not giving a #variable a value but that did not work.We have Length & Data type. 6. Indent other print statements with at least one column right. SQR runtime files require a . How do I Reference Global variable in a local procedure in SQR? I can access Global variable with #_VariableName from local procedure.We don t have Length & Data type. 0 was inserted. 3. 3.#. Substitution Variables. We should insert data in to Array by programming. 2.&) we use underscore(_) after that variable name. How do I right justify a text string? Use the LPAD function of the LET command to add blanks to the start to the string. Are SQR commands and variables case sensitive? No. number of added. What types of SQR variables are read only ? Database column variables and most internal reserved SQR variables are Read Only. How do you Optimise SQR ? a) You can optimise SQR by breaking big sql statements into simple sql statements. Arrays can be declared in any section. 1.sqt extension. 4. 4. $String. 4. Commands can be spelled with any case combination. Document Variables.5. 5. Load-Lookup is declared in only in SETUP section only. and User Defined Variables What is #.sqr extension. d) Examining Cursor Status by using -S flag while executing sqr. Syntax: Load-Lookup Name=<name> Table = <tablename> Key = <primarykey> Return_value = <FieldName> Where = FIELDNAME= <fieldname> .We can retrive only Two fields from a table. ' ') How to print current date in SQR? : Print $current-date (1. For example: let $s = lpad($s.Variables And Arrays What are different types of variables in sqr? Types of variables in SQR are 1. Rows are automatically inserted in to Load-Lookup. 5. List Variables. Move the desired value to the SQR variable #page-count. 6. and &Database field values. How to Define Constant & its usage in Begin-Select? #define MAX_LABEL_LINES 10 Can I set the current page number in an SQR program? Yes.

In some PROGs. If used in the SETUP section. Is it possible to increase the array size once defined? No. Ucan reduce the number of tables that are joined in one SELECT. No. When it keeps the number of tables being joined from exceeding three or four. and they are used often. How do you Define arrays in SQR ? Ans: Syntax: #define array-size 50 Begin-Setup CREATE-ARRAY NAME=<arrayname> SIZE=<size> FIELD=<fieldname>:<DataType>:<Size> End-Setup How do you Fetch values from Arrays in SQR? used for inserting values in array. The LOOKUP command looks up a key in the array and returns the associated value. When the number of entries in the LOAD-LOOKUP table is small compared to the number of rows in the SELECT. An array is similar to a database table. You can use LOAD-LOOKUP in the SETUP section or in a procedure. it is not possible to increase the Array size once defined What is the difference between Arrays & Loadlookup? Which is faster. Get & Put is 2. Use this command in conjunction with one or more LOOKUP commands. LOAD-LOOKUP improves performance in the following situations: When it is used with multiple SELECTS. If used in a procedure. this technique performs better than a conventional table join. The LOAD-LOOKUP command defines an array containing a set of keys and values and loads it into memory. it is processed only once. An array is similar to a database table. When most entries in the LOAD-LOOKUP table are used With LOAD-LOOKUP. a database join or LOAD-LOOKUP? It depends on your PROG. With LOAD-LOOKUP. In Arrays we contains the data in load lookup array contains the set of keys and associated values. but it exists only in memory. Syntax: begin-setup load-lookup name=prods table=products key=product_code return_value=description end-setup Can Multiple Columns be retrieved in LoadLookup command in SQR? Yes. you can reduce the number of tables that are joined in one SELECT. What is the difference between Arrays & Loadlookup? Arrays: An array is a unit of storage that consists of rows and columns and exists in memory. Use this command in conjunction with one or more LOOKUP commands. it is processed each time it is encountered Arrays : An array is a unit of storage that consists of rows and columns and exists in memory. it has to be joined by a double pipe symbol ( || ). . Use of a lookup table is dependent on not having duplicate keys. but it exists only in memory. will the lookup table still work correctly.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. If I get a duplicate key warning message when SQR loads a lookup table.

two arrays are created²one to summarize monthly orders by product. and another to summarize monthly orders by price range. However. Syntax In the SETUP section: LOAD-LOOKUP NAME = lookup_table_name TABLE = database_table_name KEY = key_column_name RETURN_VALUE = return_column_name [ ROWS = initial_row_estimate_int_lit ] [ EXTENT = size_to_grow_by_int_lit ] [ WHERE = where_clause_txt_lit ] [ SORT = sort_mode ] [ CURSOR = cursor_int ] [ QUIET ] What are the different types of Arrays in SQR? Single dimensional. if your report is small and the number of rows to be joined is small. b) Put values into $fieldName. and in fact can be slower. summary salary) of employee 2 DA used in generating the customer details and order details 1 DA company id 15.sqc. a lookup table cannot be warranted. .Loadlookup: Function Loads an internal table with columns from the database. since the entire table has to be loaded and sorted for each report run. but joins take substantially longer. BEGIN-SETUP create-array name=order_qty size={max_products} field=product:char field=month_qty:number:3 create-array name=order_qty2 size={max_categories} field=category:char field=month_qty:number:3 END-SETUP How you can declare 2nd dimensional Arrays? Create array Name : purchage array size = 100 Field1: price:num Field2: qty :num create-array name=order_qty size={max_categories} field=category:char field=month_qty:number:3 How do you Use XLATT table in SQR ? a) Include ReadXlat. job. 3 dimensional array. In the SETUP section. Allows for quick search using the LOOKUP Usually this type of lookup can be done with a database join. 3 DA used in generating the (depend. and 2 dimensional. How you can declare 2nd dimensional Arrays? Using multiple arrays can allow you to reduce database calls. $fieldValue c) Call procedure read-translate-table d) Get $XLATLongName & $XLATShortName from XLATTABLE of PS database.

Cannot be used for Interface writing. It provides GUI Interface for creating reports. 10) EDIT bbb9 Mostly used Format commands in SQR: CENTER: Center text EDIT: uses masks to control the format of the output FILL : fills the specified length with characters specified. word document etc.345. LOAD-LOOKUP : Loads columns into an internal array.67 What are the different types of PRINTER commands? Note the use of the ALTER-PRINTER command. 20) box CENTER Centers the field on a line. size and source of an image. 1. EXP print #total (7. You cannot write complex programs. If you are using the system shell.0) edit $999. You cannot hold intermediate data. Use the following commands: DECLARE-PRINTER take effect only when you print your report with the printer you specify with the TYPE argument. 20) bold BOX Draws a one-line deep graphical box around the printed data. -PRINTER:LP for line-printer output -PRINTER:PS for PostScript output -PRINTER:HP for HP LaserJet output PRINTER:WP for Windows output -PRINTER:HT for HTML output. ON-BREAK: allows you to specify an action/procedure in tabular reports when break occurs in the value of the field. DECLARE-PRINTER : Overrides the printer defaults. which specifies the output type for your report.Difference between SQR/Crystal/nVision ? SQR ReportCrystal ReportNVision ReportGUI It does not provide GUI interface to create reports.55.Only prints reports based on PSQueries. What is a difference between EDIT & Format in SQR? EDIT is used for formatting while printing & Format is usedwhile Input especially for date. PRINT { any_lit | _var | _col } position position means: BOLD causes the string or number to be printed in bold type. DECLARE-VARIABLE : Allows user to explicitly declare a variable name. at the most you can use few If-Else statements based on the data fetched. CREATE-ARRAY: Creates an array of fields to store and process data DECLARE-CHART: Defines attributes of a chart. DECLARE-LAYOUT: Defines attributes of a report layout. How do you make a zero value blank on a report? Print #varname (+1. USE : Overrides default database (Sybase and MSSQLServer only) Types of PRINT commands? Function Puts data on the page at a specified position. EXP print &grand_total (+5.99 ! $ 12.Programming Language SQR language for reporting is a programming language in which you can create your own SQC s libraries for reusability & also you can hold intermediate data for processing etc.It provides output only for Excel spreadsheets. Crystal Reportoutput can be of any type. BEGIN-SQL : Begins an SQL paragraph. Excel Specific Output SQR Report output can be on text file.Cannot be used for Interface writing. DECLARE-PROCEDURE DECLARE-REPORT: Defines reports and their attributes. Uploading/Downloading data from flat file to PS & vis-a-versa.Interface writing. It provides GUI Interfacefor creating reports. DECLARE-IMAGE: Defines the type.999. enter the following on the command line: sqr test username/password -printer:ps . This command changes the font in which the report is printed. BEGIN-SETUP includes following commands: Ask : Prompts the user for substitution variable. EXP :print ¶Quarterly Sales¶ (1) center EDIT edit_format EDIT causes each field to be edited before it is printed. declare-report labels layout=labels printer-type=ps end-declare The first method is to use the -PRINTER:xx command-line flag. EXP:print &name (+1.

-E : Specifies that an error file be created and allows you to specify the filename. otherwise returns a value of 0. $Sql-Error: Text message of error returned from DBS.sqt extention. Ltrim. DB2.Returns the number or characters in source_value. -O : Filename for the log file. Nvl.Extracts the specified portion of source_value. -M :SQR configuration file.Returns the numeric position of sub_value in source_value or 0 if not found. Request for input will be made in Windows dialog boxes. #Current-Line : Current physical line on a page $Current-Date : Current date time on the local machine when sqr is running. SQLBASE. -S :Displays the status of the all cursors at the end of the run.. Opposite of this is Unstring Extract-Copies a portion of a string into string variables generally used in file manipulations. $Sqr-Locale : The name of the current locale being used. -DEBUG: Used in conjunction with #debug command to display additional information when troubleshooting SQR programs. String-This creates a string.MVS.lis file should be created. Valid values are WINDOWS. -CB : Forces communication box. UNIX. Example: EXTRACT $area_code from &home_phone 0 3 Print is most commonly used stmt. SQR provides internal.max) -PRINTER : Causes printer type to be specified.Returns y_value if the x_value is null. instead of in the default location.SQC or other include program files.Trims characters in source_value from the left until a character is not in set_value and returns the result.WINDOWS-NT. -. Creates a file with the *. This value is database dependent. INGRES. -F : Specifies a file or directory where the *. VMS. -XCB :Do not use communication box.not city . Lpad. $sqr-ver: The text string shown with -ID flag. $Sqr-Database: The database type for which SQR was compiled. #Sqr-pid: The process ID of the current SQR process. -Tnn : Specifies you to run SQR in test mode for the specified(nn) number of pages. #Page-Count : Current page number (can be reset). Valid values are ORACLE. #Sql-Count : The # of rows affected by an SQL DML statement. This is used for troubleshooting SQR programs. #End-File : set to 1 if end of file occurs. To_char. -I : Location of *. #Sql-Status : Status value from database after each query is compiled/executed. otherwise returns x_value. Length. reserved variables with values maintained & updated by SQR. Used to modify default SQR properties(AllMaxes. Example: let $city = nval(&city. Instr. Functions (Most commonly used) Isnull.Pads the source_value on the left to a length of length_value using pad_value and returns the result. To_Number.Returns a value of 1 if source_val is null. VM. -C : Cancel dialog box appears so that user can terminate the program. #Return-Status : value returned to operating system when sqr exits. #Current-Column : Current column on page. $sqr-program: The name of SQR program file.0) Substr.Common Flags used for SQR s -A : Causes reporting output to be appended to an existing file of the same name. INFORMIX. PeopleSoft does not use runtime SQR programs. -RS : Creates a runtime version of your SQR.) Round(#avg_length. Show and Display are also used Evaluate Example: EVALUATE<variable> WHEN = <value> WHEN = <value> WHEN-OTHER <default SQR command(s)> END-EVALUATE . $sqr-platform: The hardware/operating system type for which SQR was compiled.SYBASE and ODBC.

syssql.sqc. systree. dddaudit. List out some of them? SQC is used as Functional Library mainly used to re-use code and get some predefined functionalities used for our SQR programs.sqc..sqc : This file contains generalized routines to format numbers.sqc: This is used to set the Default Environment based on the Database such Printer Type.sqc. SETUPxx. Date formats Etc . Paper Size. sysae. . This is nothing but the Actual Source program. What is the purpose of SQCs? We can define the function in sqc's .sqc.sqc. by including those SQC¶s and calling those functions in our SQR program we can get the functionality of that function. This can be Compiled & Executed. curdttim. This is like a function in SQR.SQC.SQC & PRCSDEF. SETENV. SETENV.then call the sqc's in sqr PROGs like c and c++ header files. Get-Process-Language(). sysxlatt. SETENV.sqc.sqc.SQC.sqc : This is an important Footing SQc.. 3. Update-Prcs-Run-Status(). We can call one SQC from another SQC or SQR program What is sqc? SQC¶s are nothing but some functions in SQR. We cannot call one SQR from another SQR or SQC. DATETIME. 2.sqc.sqc What procedures are defined in PRCSAPI.RESET.sqc. This does not consists of program Section.sqc: This Is Process Scheduler Interface which is used to initiate and terminate some field values such as Process_instance & Run_cntl_id 2.sqc : This file contains generalized routines to format dates and times. Some of the Important SQC are STDAPI.SQC? PRCSAPI. dddtable. reset.sqc #Include 'datetime.sqc. we can see the status of that SQR program in process This is a Process Scheduler Interface sqc which is used to initiate and terminate some field values such as Process_instance & Run_cntl_id monitor. 1.SQC? This is used to set the Default Environment based on the Database such Printer Type.sqc.What is the difference between sqr and sqc? SQR SQC 1. datetime. 3.sqc. Structure query copy book is library used in SQR PROGs as #include setenv.sqc. This cannot be Compiled and Executed.sqc' !Routines for date and time formatting #Include 'curdttim.sqc' !Routines to format numbers 3. 4. Paper Size. sysfield. This consists of Program Section. DATETIME.SQC is mainly used to make our SQR program API aware. STDAPI. What are the different type¶s sqc¶s? setenv.SQC.sqc. 6. sysversn. 4.sqc.sqc. dddviews. syspage.RESET.sqc' !Get-Current-DateTime procedure #Include 'number. NUMBER.SQC . Some of the most commonly used SQC s are .SQC. 4.SQC: Define-Prcs-Vars() This procedure will define and initialize the various process scheduler variables.ie. NUMBER. STDAPI..SQC: Get-Run-Control-Parms(). What is SQC. sysquery. PRCSDEF.sqc. sysrecord. dddindex.sqc.here. sysmenu. 3.Date formats Etc . STRING.SQC etc. we have reusable code. 2. sysaudit.sqc. 1.SQC. number.

Standard SQCs
y Askftd.sqc - This asks from/thru date for reporting of heading y Askaod.sqc - Procedure to call is Ask-As-of-Date y CurDtTim.sqc - Gets the Current Date Time from System y DateTime.sqc - Convert date from system format calling InitDate-Time procedure to set format. y DateMath.sqc - Converts Native Date format to YYYY-MM-DD. y Eoj.sqc - determines End of job for an SQR report. y FSHdg01.sqc,FSHdg04.sqc - for Standard Headers for PS Financials. y Number.sqc - Provides Number related Functions y Opsys.sqc - Operating system settings. y PrcsApi.Sqc - Used in Process Scheduler SQR Programs, to get Run control parameters y RDBMS.sqc - Database Settings. These files uses #DEFINE command to set the variables. y ReadXlat.sqc - Read the Translate Table for the desired values (Very Important) y Reset.sqc - Used for Footing Section that prints End-of-Report . y SetEnv.sqc - Sets Environment for Country, Printer-Paper, Language, Date, Platform specific parameters, It also contains Opsys.sqc, RDBMS.sqc y Setup01.sqc - This is generally called from Begin-Setup section for Portrait Size y Setup02.sqc - This is generally called from Begin-Setup section for Landscape Size y STDHDGTR.sqc - Performs Language Conversion y STDHDG01.sqc - Provides Standard heading for language conversion y StdApi.sqc - Gets Std API calls y Trancntrl.sqc - Purpose is to COMMIT, ROLLBACK etc. across DB platforms y Convertcurrency.sqc y AllMaxes.max - It is used for dynamic memory allocations before the execution of SQR.

What is the SQC used to read data from translate table? READXLAT.sqc is the SQC used to read data from Translate Table. How will you display an IMAGE in SQR? Using DECLARE-IMAGE , END-DECLARE command.

What is a Syntax for using SQC's in SQR? #include 'setenv.sqc'. Which SQC file is used for From Date and To Date. AskEfdt.sqc Which SQC tells you that some Job is completed? Eoj.sqc tells you about that. Which SQC is responsible for system memory allocations? AllMaxes.max How to Avoid double declaration of an SQC file? To check this writes all procedure of an SQC in the following:
#Ifdef <constant> #define <constant> <write all procedures of an sqc file> #endif
What SQC is found in every PeopleSoft SQR program? : SetEnv.sqc What SQC files are commonly included in almost all PeopleSoft SQR programs?

CurDtTim.sqc, Number.sqc and Reset.sqc.
Which SQC file should be modified to include your standard company heading ?

XxHDG01.sqc where xx is for either HR for Human Resource or FN for Financials.
What are the most common uses of SQC files ?

a) Setup Section b) Standard Headings Footing Section User prompts Get related data Process Scheduler processing How can I suppress display of the SQR banner line when running SQR? Use the -XB flag.

STDAPI :
DESCRIPTION:

Process Scheduler Interface It can be used in other SQRs by performing a "do STDAPI-INIT" "do STDAPI-TERM" !Updates process scheduler status

#Include 'stdvar.sqc'

STDAPI: Standard Variables begin-procedure Define-Standard-Vars let $Payroll_NID_Type = 'PR' end-procedure #Include 'prcsdef.sqc' #Include 'prcsapi.sqc' #Include 'eoj.sqc' !Update Process Request variable declare !Update Process API !Updates process scheduler status

PrcsDef :

Procedure to define the Process Scheduler variables.

DESCRIPTION: It can be used in other SQRs by performing a "do Define-Prcs-Vars"

PrcsAPI :

Procedure to update the Process Scheduler request record and get the run control parameters.

DESCRIPTION: It can be used in other SQRs by performing a "do Get-Run-Control-arms" "do Update-Prcs-Run-Status"

(We need to indicate that we're in Update-Prcs-Run-Status because if there is an error that goes to SQL-Error (sqlerr.sqc), that will try to call back here. If the error came from here, though it would be an infinite loop in all likelihood. So, we set the indication to prevent the call back here.)

SQLERR :

SQL Error Handling Procedure

This procedure is typicallly called via the ON-ERROR condition of BEGIN-SQL and BEGIN-SELECT. "do Update-Process-Status" "do Get-PrcsRqst-Info" do Get-Last-Message-Seq do Parse-Message-Parms do Set-Client-Info do Process-Message-Log do Insert-Message-Log do MS-Set-Client-Info Perform end of job processing if successful status #include "tranctrl.sqc" "Get-Job-Instance" do Check-Message-Parms do Insert-Message-Log-Parm

EOJ

:

DESCRIPTION: It can be used in other SQRs by performing a "do Successful-EOJ"

SETENV :

#include 'rdbms.sqc'--- (Database Environment)

#define ORACLE

#include 'opsys.sqc'----(Operating System Environment) #define AXP #define MVS #define NT #define OS400 !Country #define UNIX #define VAX #define VMS

!BasePeopleTools Version

!Printer

!Process Schedulder OUTDESTTYPE (ODT) !Process Schedulder OUTDESTFORMAT (ODF)

! Print Specific Language #ifdef NT #define FILEPREFIX C:\TEMP\ #define FILESUFFIX #end-if !

!Paper Size

!Language

! File prefixes and suffix

#ifdef MVS #define FILEPREFIX #define FILESUFFIX #define EBCDIC #end-if !Return Status #define GOOD-OS-STATUS 0

!Global Date Defines #define DEFMDY 'MDY' #define DEFDMY 'DMY' #define DEFYMD 'YMD #define DEFDATE 'DATE' #define DEFCMP 'CMP' #define DEFROM 'ROM' #define DEFKAN 'KA ! PTRPTYear Used in determining what format to display the year in. This does not affect the format used to talk to DB) ! Meta SQL (For Use in SQL Statements Only) ! Meta SQL (For Use in SQL Statements Only) ! #define PTConCat || #define PTTRUNCATE DELETE FROM #define PTSubStr substr ! Standard INFORMIX parameters

! Standard MICROSOFT parameters

After each CONNECT. If no ON-ERROR procedure is specified and the logon fails. )] ] Arguments txt_lit | _var | _col ± Specifies a user name and password for the logon. so beware of security issues. You can optionally specify arguments to be passed to the ON-ERROR procedure. The SETUP section. For How can you send a mail to person? If this is AE. ON-ERROR ± Specifies a procedure to be executed if the logon fails. across platforms. Syn:CONNECT { txt_lit | _var | _col }[ ON-ERROR= procedure [ ( arg1 [.event and mail setting the properties and connected by routing. Activity and Event where in I gave the email address of the person or used a Role Query. I write a WF PeopoleCode using TriggerBusinessEvent function I can send a mail. CONNECT SQR 4. column. It begins with BEGIN-SETUP and . the command used to send email is .. . If this is SQR. the reserved variable $username is set to the new user name. ROLLBACK.Iused PeopleCode at component level or Record level to Trigger the WF. SQR halts with an error message. is typically placed at the top of the PROG before the PROG section.! Meta SQL (For Use in SQL Statements Only) ! #define PTConCat + #define PTTRUNCATE TRUNCATE TABLE #define PTSubStr substring ! Standard ORACLE parameters ! Meta SQL (For Use in SQL Statements Only) ! #define PTConCat || #define PTTRUNCATE TRUNCATE TABLE #define PTSubStr substr TRANCTRL : Common Transaction Control Procedures DESCRIPTION : The purpose of this SQC is to support COMMIT. You should not Issue a CONNECT within a SELECT or an SQL paragraph while a query is actively Fetching or manipulating data from the database.set WF or Worklist. For this to happen.. I did set up the WF in such away that is send email to a person or group by settings the properties in a business process. it can be used in other SQRs by performing a "do Commit-Transaction" rather than a "commit". Description: The new user name and password can be stored in a string variable.. I know how to create Role queries. example. À Warning the username/password is not encrypted.. column. or literal. argi ] .0 Examples: Connect $new-user on-error=bad-logon($new_user) Connect ¶sqr/test¶. etc. we have to have mail server set in Unix box. For WF.. Using activity . if present. Can we Change the login id of other DB using SQR? Using CONNECT Function Logs off the database and logs on under a new user name & password.develop Business process. The command used to send email is. or literal. Arguments can be any variable. All database cursors or logons are closed before the CONNECT occurs.

SQT) is loaded. or BEGIN-PROG section. How you can Update values by using SQR? In beging sql write update table name set where coloum name with out set condition total table will be updated«.These apllication Libraries are with out having MAIN section. c and c++ . before the PROG BEGIN-SQL Can also appear in a procedure.. In SQR functions parameters are passed by Reference or value? Objects are passed by reference and variable assigned values are passed by values. What Are The Application Libraries? In AE this is the one type Prog. 4. they r begins executing.. [$col1] . To do so. DECLARE-CHART DECLARE-IMAGE DECLARE-LAYOUT DECLARE-PRINTER DECLARE-PROCEDURE DECLARE-REPORT DECLARE-VARIABLE Can also appear in a local procedure. This paragraph can reside in a BEGIN-PROCEDURE. 17. processed at compile time. May be What is the use of SkipLine? Further enhance the visual effect of break processing by inserting one or more lines between groups.) End-Sql Can we write Insert and Update in a single Begin SQL section. Executed when a run-time file (. using sqr begin-sql & end-sql section only in set-up section. 19.customer_num and [$datecol] > $start_date end-select The substitution variable [$datecol] substitutes the name of the column to be compared with $state_date.# Field Values . CREATE-ARRAY Can also appear in a procedure. Command Comments ALTER-LOCALE Can also appear in a procedure. like header files in sqr . Can we create table-using sqr? Yes.Using Process scheduler 3.Dynamic variable should be on [ ] You can also use Dynamic SQL in some situations to simplify a SQL statement and gain performance. 12. ASK Allowed only in SETUP section. use the SKIPLINES qualifier with ON-BREAK««& The SKIPLINES=1 argument skips one line between records. LOAD-LOOKUP Can also appear in a procedure. The SELECT is simpler and no longer uses an OR. Using SQRW (in TwoTier) 2. In procedure section only dml commands can be given. 16. About Begin SQL :Function Begins an SQL paragraph. If used. then renumbers the current line as line 1. How does u represent variables in sqr? Variables . How many types you Run SQR¶s? 1. .The following commands can be issued in the SETUP section. this use of dynamic SQL improves performance. you can run the SQR Using Shell Scripts.[$col2] : At run time. #order_num. BEGIN-SETUP.customer_num = customers. insert into orders values ($customer_name. Examples Begin-Sql update orders set invoice_num = #next_invoice_num where order_num = &order_num end-sql begin sql delete orders where order_num = &order_num. Dynamic SQL enables you to check the value of $state and create the simpler condition: if $state = 'CA' let $datecol = 'order_date' else let $datecol = 'ship_date' end-if begin-select order_num from orders..In UNIX.& How you can declare Dynamic variables in SQR? Dynamic variables by enclosing them in square brackets. USE SYBASE only.$ Numeric . In most cases. Write in Begin-select using update commad end-select 16. For example. customers Where order.

Example: begin-program use-report listing use-printer-type ps use-report labels use-printer-type hp use-report form_letter use-printer-type lp do main end-program What's the effect of the -PRINTER command line flag in a multiple report program? It overrides the printer type for all the report. etc. What type of variable does the INPUT command use? The INPUT command always inputs into a TEXT variable.Can I write a matrix report in SQR? Yes.tmp for program techtip. one for each printer type (lp. The temporary file is deleted at the end of the procedure. Efforts. Such as Left-Margin = 1. How do I have different reports generate output for different printers in the same program? U have to place an appropriate USE-PRINTER-TYPE after the corresponding USE-REPORT. you can have them in any order. Example of a SQR cross-tab (matrix) report Example: Begin-Setup Page-Size 60 133 declare printer type = postscript orientation = landscape line-size = 8 char-size = 6 End-Setup MULTIPLE REPORTS*************** How many DECLARE-PRINTER commands can a program have? At the most. procedure before From Clause in Begin-Select to print for each record. one for 'default-ps' and one for default-hp'. ps) for each report plus one declaration for 'default-lp'. Tasks. How do you print a document/letter using SQR? Using Begin-Document. Resources. SQR will produce an error message if you declare two hp printers for the same report (or two ps printers. The SQR pre-defined variables $sqr-report and #sqr-pid are used. . On-Break Level =1 etc.sqr ran as process ID 1234. What is Declare-Layout <layoutname> used for? It is used for defining Page Layout & includes Paper Size. End-Document in a procedure. hp. How can unique temporary file names be generated in SQR ? One technique is to combine the report name (minus the extension) with the system process ID. SQR will issue an error if you define 'default-ps' twice. Project. Call this How does SQR calculate the number of rows available for the body of the page? The rows available to the body of your report are calculated from the rows defined in PAGE-SIZE minus the number of rows reserved by the BEGIN-HEADING and BEGIN-FOOTING sections. Which table stores the translated static report values? The Strings Table. What is Master Detail Report? Report where tables with one to many relationships are involved. etc. Margins in Begin-Setup. The following example will create a temporary file named techtip1234.). Which SQL command is not allowed in the BEGIN-SQL paragraph? SELECT What will happen if you do not include an ON-ERROR=procedure in a BEGIN-SQL if your program encounters an SQL error or warning? SQR program will abort. Top-Margin=1. Do I have to have the DECLARE-LAYOUT before a DECLARE-REPORT that uses it? No.

The LET/SUBSTR command uses 1 as the first position.x. Syntax: ON-Break Level=1 skiplines= 4 After = ProcedureName vcc What is the BREAK command used for within a WHEN clause of the EVALUATE command ? The BREAK command ends the EVALUATE at that point. Labels must be left justified and GOTO label must end with Colon(:) How do we Convert Number to String in SQR? Using To char function or even by assigning. What are the restrictions governing where a GOTO label can be placed? GOTOs and their labels must be in the same Section or Paragraph. $var is string. For example: move 1 to #page-count. How do we Concatenate String in SQR? Using Concat function or || as pipes. What is the difference between the parameters for the EXTRACT command versus the LET/SUBSTR command? The EXTRACT command uses the offset 0 as the first position. How do you put a blank line in Begin-Document End-Document? Using . The default action prints the field only when its value changes (PRINT=CHANGE). How do you refer to a Constant in SQR? A constant is referred in curly braces { }.Mainly used for Redundancy of Printing on a page. How do you accept Date variable as an Input from a user ? Input $Fieldname type-date format dd/mm/yyyy . How can I reset the page number that is printed with the PAGE-NUMBER command? : Move the desired value to the #PAGE-COUNT reserved variable.100) FILL How to place a corporate logo in sqr? Using Declare Image command How do you Place a Date into Heading Section of SQR? Use Date-Time function in SQR & Page-Number. #var is numeric.What are On-break parameters? ON-BREAK causes the specified action to perform in a tabular report when the value of a field changes. What is Extract in SQR? Extract copies a portion of string into a string variable & substring is to extract a string from a string variable. What must you remember to program into a WHILE loop? u must increment your WHILE loop counter. What the use of ON-Break in SQR ? Usage: It is used to group set of records for each level & break at each level. How do you Declare a local procedure in SQR? Using Begin-Procedure <procedurename> local How do you know in SQR on which cursor position you are residing? : #Cursor-pos What is STOP QUIET used for in SQR? Stops execution of SQR & come out of it.(y.b How do you Enter a line in an SQR? Print .

the first column is the city and the second is name. the first column is called name and the second column is called city. wide enough for the widest record ! and no page breaks declare-layout default end-declare end-setup begin-program left-margin=0 top-margin=0 max_columns=160 formfeed=no do main end-program begin-procedure main encode '<009>' into $sep ! Separator character is TAB let $addr1 = 'Address Line 1' let $zip = 'Zip Code' let $cust_num = 'Customer Number' let $name = 'Customer Name' let $addr2 = 'Address Line 2' let $city = 'City' let $state = 'State' let $phone = 'Phone Number' let $tot = 'Total' string $cust_num $name $addr1 $addr2 $city $state $zip $phone $tot by $sep into $col_hds print $col_hds (1. The first time. The tabs create columns in your spreadsheet or word processing document that correspond to the columns in your database table. begin-setup ! No margins. We create an export file. begin-program let $col1 = 'name' let $col2 = 'city' let #pos = 32 do list_customers_for_state position (+1) .1) begin-select new-page cust_num name addr1 addr2 city state zip phone tot &city &state &zip &phone &tot by $sep into $db_cols string &cust_num &name &addr1 &addr2 print $db_cols () Dynamic SQL new-page from customers end-select end-procedure ! main Find the restriction against using variables where only literals are allowed somewhat restrictive. which you can load into a document such as a spreadsheet. and the program sorts by city with a secondary sort by name. The ordering of the records changes based on the user s selection.Exporting Data to Other Applications Using SQR. and the program sorts the records by name with a secondary sort by city. The second time. The program runs the SELECT twice.

33 end-declare begin-setup declare-layout default begin-program end-setup do mailing_labels end-program begin-procedure mailing_labels let #label_count = 0 let #label_lines = 0 columns 1 29 57 ! enable columns alter-printer font=5 point-size=10 begin-select name (1.let $col1 = 'city' let $col2 = 'name' let #pos = 18 do list_customers_for_state end-program begin-procedure give_warning display 'Database error occurred' display $sql-error end-procedure ! give_warning begin-procedure list_customers_for_state let $my_order = $col1 || '.1.11) left-margin=0. Sometimes you need to print labels in multiple columns.#pos) Mailing Labels : A SQR SELECT paragraph retrieves the addresses and prints them on the page. SQR enables you to print in column format with the commands COLUMNS and NEXT-COLUMN in conjunction with NEXT-LISTING.1) position (+1) from customers order by [$my_order] end-select end-procedure ! list_customers_for_state [$col2] &column2=char (. ' || &state || ' ' || $zip print $last_line (3.1.30) next-column at-end=newline . The page then becomes a matrix of rows and columns of labels.30) addr1 (2. #define MAX_LABEL_LINES 10 #define LINES_BETWEEN_LABELS 3 paper-size=(10.1.' || $col2 begin-select on-error=give_warning [$col1] &column1=char (.30) city state zip move &zip to $zip XXXXX-XXXX let $last_line = &city || '.

Clark Axelotle ACME Inc.add 1 to #label_count if #current-column = 1 add 1 to #label_lines if #label_lines = {MAX_LABEL_LINES} new-page else next-listing no-advance skiplines={LINES_BETWEEN_LABELS} end-if end-if from ps_customers end-select let #label_lines = 0 use-column 0 ! disable columns new-page print 'Labels printed on ' (.1) . We would like to tell you about our limited-time offer. During this month. end-document .999. &name &addr1 &addr2 @city_state_zip .b Thank you for your recent purchases from ACME Inc. our entire inventory is marked down by 25%.b Sincerely.1) print $current-date () print 'Total labels printed = ' (+1.b .999 end-procedure ! mailing_labels MailMerge Documents begin-program do main end-program begin-procedure main begin-select name addr1 addr2 city state zip do write_letter From customers order by name end-select end-procedure ! mainbegin-procedure write_letter begin-document (1.b $current-date Dear Sir or Madam: .1) print #label_count () edit 9.

addr1 varchar (30). begin-setup begin-sql on-error=skip ! table may already exist create table customers_ext ( cust_num int not null. phone varchar (10).tot int ) end-sql end-setup begin-program do main end-program begin-procedure main #if {sqr-database} = 'Sybase' begin-sql #endif Encode '<009>' into $Sep Open 'ex11a.position () @city_state_zip print &city () print '. Using DML and DDL: DDL can be given only in SET-UP section only. name varchar (30).lis' as 1 for-reading record=160:vary while 1 read 1 into $rec:160 begin transaction end-sql read 1 into $rec:160 ! Skip the first record. zip varchar (10).addr2 varchar (30). which is used to sort the output. city varchar (16). state varchar (2). column headings if #end-file . ' () print &state () print ' ' () print &zip () edit xxxxx-xxxx new-page end-procedure ! write_letter ASK command prompts the user for the value of the substitution variable {my_order}.

$name.30) < datenow() datediff(datenow(). $city. $addr1. $zip. city.addr1.$state.'dd/mm/yyyy') input $start_date 'Enter starting date' type=date format='dd/mm/yyyy' print &order_date () edit ¶As of Month dd.break end-if unstring $rec by $sep into $cust_num $name move $cust_num to #cust_num move $tot to #tot begin-sql insert into customers_ext (cust_num.-30) &order_date > strtodate('3/1/1999'.'dd/mm/yyyy') if strtodate(datetostr(&order_date. YYYY¶ Best Of Luck«« With Regards. name.&invoice_date. phone. zip. tot) values (#cust_num. state. $addr2.'day'. addr2.com . Venkatareddy. $phone.'day'.'day') > 30 &invoice_date < dateadd(datenow(). #tot) end-sql end-while $addr1 $addr2 $city $state $zip $phone $tot #if {sqr-database} = 'Sybase' begin-sql #else #if {sqr-database} <> 'Informix' begin-sql commit end-sql #endif #endif close 1 end-procedure ! main commit transaction end-sql dateadd(&invoice_date.gade@gmail.'dd/mm/yyyy') > strtodate('3/1/1999'.'dd/mm/yyyy').

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.