Sitemap

Getting Started with RPGLE #2

3 min readApr 6, 2023

--

This article is the continuation of previous article getting stared with RPGLE.

Let’s add data to the previously created physical file.

Physical file name — MYPF001

1. Data Insertion process

Data can be added to the Physical File using two methods.

1. Using Data file utility screen

2. Using SQL queries

1.1 Through Data file utility screen

Command — STRDFU

STRDFU — → Enter

Press enter or click to view image in full size

Select option 5 → Update data using temporary program

Program will be displayed to insert data to the physical file (MYPF001)

Press enter or click to view image in full size

Insert required data; Id, Name and Contact Number and press Enter

After completing data addition press F3, the following screen will be resulted.

Press enter or click to view image in full size

Type the choice for End data entry as Y and press Enter.

Get Jananie Perera’s stories in your inbox

Join Medium for free to get updates from this writer.

Data addition process is now completed.

1.2 Data addition using SQL queries.

Other than data file utility program data can be added to the screen using ordinary SQL insert queries.

To write SQL queries, SQL statement window should be used. SQL statement screen can be access by the command “STRSQL”.

Press enter or click to view image in full size

The following screen will be loaded. This screen can be used to write SQL queries.

Press enter or click to view image in full size

2. Accessing the Inserted Data

To access the data that we have inserted, we have two methods.

1. Using SQL Select

2. Using Run query

2.1 Using SQL Select

As explained above we can use SQL Statement screen to write SQL select quires to retrieve data from the table.

Press enter or click to view image in full size
Press enter or click to view image in full size

2.2 Using Run query

Run query can be used as follows.

Press enter or click to view image in full size

You will get the same output as the select query.

This is the end of the second article. If you like my contents, please consider following me. 😀

--

--