the FRAME generator for RPGLE and DSPF


page d'accueil
Boite à outils

Cette page a été mise à jour le 7 juillet 2022. 
Contact

Welcome page
Tools box


FRAME

Versionning 

last version: Ask me This tool is not free.

I had the idea of this tools in the 90's, when I was writing in COBOL. I started to create a prototype of the tool but finally stopped, no popularity.

A few years ago, when reading a C program, I discovered the macro feature. Interested by the idea of one line generating many others, I remember the idea of Frame, a solution to another problem: I had discovered for DSPF how to remove indicators (with a display attribute field) and to work with mouse click. The steps to add these features into DSPF was a few high and require automation to be able to add code in my RPG program and my DSPF at many different places at the same time.

The main idea is to describe my DSPF instead of coding my DSPF.

Advantages:

Don't think DSPF is dead, the back office applications still use command and batches. Administrators love automation. Whatever the operating system.

The concept of Frame is considering a program (DSPF, RPG …) as just the text of a document. The table of contains (TOC)  is the frame: if I had a tool to define a frame in a note pad, I will be able to

This is the basic concept.

Let me show an example of TOC of a RPG program:

Frame Structure

-         *START
|-         rpg
||-         head
||-         file
||-         data
||-         code
|||-         main
||||-         main_data 
||||-         main_code 
||||-         main_sr
|||-         output
|||-         procedure

At the beginning, there is only one frame: *START.

In this frame, I add the RPG frame.

You get there the principle.

And in true life?

I have this code:

// f/begin_macro rpg
// f/add_frame RPG
// f/frame rpg
// f/add_frame head
// f/add_frame file
// f/add_frame data
// f/add_frame code
// f/frame code
// f/add_frame main
// f/add_frame output
// f/add_frame procedure
// f/frame main
// f/add_frame main_data
// f/add_frame main_code
// f/add_frame main_sr

As a part of the source file JPLTOOLS/FRAME(FR_RPG)

When called, it creates the main backbone of an RPG program.

My program contains at the beginning these 2 lines:

// f/insert mbr($srclib,$srcfil,fr_rpg)
// f/macro rpg

After the execution of the second line, the backbone is ready.

FRAME supports variables. A variable is a name starting with $(dollar)

The first task of the FRAME command is to

In this example:

FRAME INFILE(JPLTOOLS/FRAME) INMEMBER(FRAME2) OUTFILE(JPLTOOLS/jpltools) OUTMEMBER(FRAME2) PRINT(*YES) debug(*yes)

The initial list of variables is:

$genfil(JPLTOOLS)
$genlib(JPLTOOLS)
$genmbr(FRAME2)
$srcfil(FRAME)
$srclib(JPLTOOLS)
$srcmbr(FRAME2)

FRAME supports RPGLE (fixed and free formats) and DSPF. It is easy to extend to other languages, but for now I use it only for RPGLE, SQLRPGLE and DSPF.

The FRAME language:

FRAME instructions are inserted as comments in any source code. Each instruction starts with a Frame tag.

This tag is compatible with INDENT, my command to colorize RPGLE code under STRPDM (I'm a fan of STRPDM)

FRAME Verbs:

// f/*    
Comment
// f/insert mbr(lib,file,membre)    
Add a member to the code
// f/inserti ...    
Add an IFS file to the code
// f/begin_macro  name    
Declare & starts a macro
// f/clear_macro    
Clear a macro
// f/end_macro    
Close a macro
// f/continue_macro name    
Such as Begin_Macro, but without clear_macro
// f/end_continue   
Stop adding code to a macro
// f/macro     name    
Call a macro
// f/add_frame framename    
Add an entry point in current frame
// f/frame     framename   
Redirect output to this frame
// f/set       var(value)    
Create a variable
// f/set_i     name(value [operator value ...])    
Create an integer variable (allowed operators are +, -, * and  /  )
// f/unset     var    
Delete a variable
// f/set_dump    
Dump all variables in the log PRTF (debug feature)
// f/if        (value operator value)    
// f/elseif    (value operator value)   
Starts conditional execution. Allowed operators are =, <>, <=, >=, < and >
// f/else
Conditional execution, the other cases
// f/endif
Ends any conditional execution
// f/clear_frame    
Clears current frame