Creating a Library and Source Physical File
Source statements are entered into a member of a source physical file. Before you can enter your program, you must have a library and a source physical file.
To create a library, use the CRTLIB command. To create a source physical, use the Create Source Physical file (CRTSRCPF) command. The recommended record length of the file is 112 characters. This record length takes into account the new ILE RPG structure as shown below.
ILE RPG Record Length Breakdown
Since the system default for a source physical file is 92 characters, you should explicitly specify a minimum record length of 112. If you specify a length less than 92 characters, the program may not compile since you may be truncating source code.
For more information about creating libraries and source physical files.
Using the Source Entry Utility (SEU)
You can use the Source Entry Utility (SEU) to enter your source statements. SEU also provides prompting for the different specification templates as well as syntax checking. To start SEU, use the STRSEU (Start Source Entry Utility) command. For other ways to start and use SEU, refer to the ADTS for AS/400: Source Entry Utility manual.
If you name your source file QRPGLESRC, SEU automatically sets the source type to RPGLE when it starts the editing session for a new member. Otherwise, you have to specify RPGLE when you create the member.
If you need prompting after you type STRSEU, press F4. The STRSEU display appears, lists the para meters, and supplies the default values. If you supply parameter values before you request prompting, the display appears with those values filled in.
In the following example you enter source statements for a program which will print employee information from a master file. This example shows you how to:
Entering OPTION(2) indicates that you want to start a session for a new member. The STRSEU command creates a new member EMPRPT in file QRPGLESRC in library MYLIB and starts an edit session.
The SEU Edit display appears as shown below. Note that the screen is automatically shifted so that position 6 is (for specification type) at the left edge.
Edit Display for a New Member
Source for EMPRPT member
This shows the DDS which is referenced by the EMPRPT source.
DDS for EMPRP
To create a program from this source use the CRTBNDRPG command, specifying DFTACTGRP (*NO).
Using SQL Statements
The DB2 UDB for iSeries® database can be accessed from an ILE RPG program by embedding SQL statements into your program source. Use the following rules to enter your SQL statements:
Note:SQL statements cannot go past position 80 in your program.
SQL Statements in an ILE RPG Program
You must enter a separate command to process the SQL statements.
IBM - RPG Related Interview Questions
|IBM-ILE Interview Questions||IBM Informix Interview Questions|
|IBM DB2 Interview Questions||SQL Database Interview Questions|
|IBM AIX Interview Questions||SQL Interview Questions|
|AS400 Interview Questions||DB2 SQL Programming Interview Questions|
|IBM Integration Bus Interview Questions||Synopsys Interview Questions|
|Rpgle Interview Questions|
Ibm - Rpg Tutorial
Overview Of The Rpg Iv Programming Language
Rpg Programming In Ile
Program Creation Strategies
Creating An Application Using Multiple Procedures
Using Source Files
Creating A Program With The Crtbndrpg Command
Creating A Program With The Crtrpgmod And Crtpgm
Creating A Service Program
Running A Program
Calling Programs And Procedures
Rpg And The Ebusiness World
Obtaining A Dump
General File Considerations
Accessing Database Files
Accessing Externally Attached Devices
Using Workstn Files
Example Of An Interactive Application
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.