search results

Devel(UP) Your Skills

Thursday, June 12, 2014

RPG V7R1 new features

The following are the new features of RPG in V7R1

1) Open access
2) Sorting and searching data in Data Structure Arrays
3) New operation extenders
4) %Lookup works with Datastructure Array
5) New BIF %SCANRPL
6) No need to have prototypes for subprocedures that are internal to the module
7) New keyword RTNPARM on the (Procedure Interface level) PI level
8)  ALIAS Longer names defined in DDS /SQL can be accessed in RPG
Sorting and searching data in Data Structure Arrays

Open Access
Now using file manipulation opcodes ( READ, WRITE, CHAIN, EXFMT ) we can access the data that is available not only on the 5250 stream. We can access from browser , Handhelp devices..etc..
For that we need to write the program which handles the request made by the RPG program and these are called “ Handlers
We can have now sort the data in the Data Structure
Example:
 D InvoiceInfo     DS                  Dim(1000)
 D                                           Qualified
 D  Invoice#                       8    
 D  Invdate                          D     
 D  InvAmt                       12p 2  
    // If wanted to SortByName
      SortA  InvoiceInfo(*).Invoice;
    //If wanted to SortBy InvAmt
      SortA  InvoiceInfo(*).InvAmt;
The * indicates the level at which the sorting should occur. Of course, in this example, it’s pretty obvious, since it’s the only level where sorting is possible. But this sorting capability also works with nested Data Structures, so even very complicated structures can be sorted.

Two new operation extenders are available for SORTA
SORTA(A) -  for ascending
SORTA(D) – for descending

%Lookup works with Datastructure Array
Example:
Index = %LookUp( ‘ABC’: InvoiceInfo(*).Invoice#);

New BIF %SCANRPL ( To scan and replace )
This BIF is combination of %SCAN and %REPLACE

No comments:

Country calling code