tags:

views:

243

answers:

2

Is there any method to clear the screen in RPG for the AS400? I'm looking for something with the same result as clrscr() in C.

A: 

Having had programmed on AS/400 (College) and IBM/390 (Commercial), I cannot remember how to do this in RPG IV, but a quick search yielded the hit here on a page that talks about using ILE dynamic screen manager here.

Hope this helps, Best regards, Tom.

tommieb75
+6  A: 

You can clear the screen with RPG, but it's not like clrsrc()

RPG does not address the screen directly. You work with a device file aka display file (DSPF). The standard way to create that file is with DDS source and the DDS compiler (always available on a AS/400). The DSPF has one or more records. The RPG program writes or reads these records. If you write a record that is defined with the keyword CRLR(), then your screen will be clear. Also read about OVERLAY() that goes hand in hand with this keyword.

All information is in the IBM information center. DDS is described in the IBM DDS reference (pdf)

I guess that you need to start with understanding the mechanism (RPG programmers guide (pdf). It is quite simple but need a little reading.

Disclaimer: there are more ways to do this (including dirty & nasty tricks). But RPG+DDS is the preferred, standard, and most-used way in the iSeries world.

robertnl