× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Additional RPGLE Enhancement Requests
  • From: "Greg Thielen" <gregt@xxxxxxxx>
  • Date: Sun, 13 Jul 97 10:41:13 -0700

On Fri, 11 Jul 1997 23:00:46 -0400, Charlie Massoglia wrote:

>If you are logging suggestions, how about taking care of the following, most
>admittedly minor, irritants:

>4.  Permit arithmetic in the %SUBST function in D-specs, e.g.
>
>    D  Combined     30A
>    D   Field1         %SUBST(Combined:1:%SIZE:Field1)
>    D   Field2         %SUBST(Combined:%SIZE(Field1+1):%SIZE(Field2)
>    D   Field3         %SUBST(Combined:%SIZE(Field1+Field2+1):%SIZE(Field3)

I haven't had to use this yet, but if it is available, the correct
syntax is probably
%SUBST(Combined:%SIZE(Field1)+%SIZE(Field2)+1:%SIZE(Field3)).  If you
can't do arithmetic like this, it should be added since each
expression is really a constant.

>5.  Permit INDIVIDUAL fields to be externally defined without having
>    to define an externally defined data stucture.
>
>    D   Temp2   S      like(field2:filename1:optrecfmt1)
>    D           DS
>    D   Temp4          like(field4:filename2:optrecfmt4) 
>    D   Temp3          like(field3:filename1:optrecfmt1)
>
>    where filename1 and filename2 are not used at all in the program.

ABSOLUTELY.  I've asked for this before, too.  Hans' (IBM's) response
was to create an external data structure containing _all_ database
fields (like a data dictionary), then use LIKE against the names in
the huge external DS.  Even if you did this with just the DB file(s)
that contained the fields you wanted to "like define", it would still
be a mess.

>6.  Permit the name of an externally defined file to optionally show
>    up in DSPPFMREF output.
>
>     D dsname   E DS    EXTNAME(filename)  LOG(*YES)
>
>     where filename is NOT defined in F-specs.

This is another absolute requirement.  I have situations where I pass
an entire record format as a parameter between programs because the
access method is fairly complicated.  I currently have to remember
which files are accessed this way and manually scan for each program
that uses this "API".  It would be ideal for this reference to show
up on DSPPGMREF output.

>7.   Permit a file to be read sequentially by key WITHOUT requiring
>     the file to be defined in the F-specs to be keyed.  If you want
>     to use OPNQRYF on the DSPOBJD outfile QADSPOBJ (or any other
>     outfile), you must define a dummy logical file to compile the
>     program.  This does not make sense.  It is understood that you
>     would probably not permit random access, SETLL, SETGT, or any
>     operation which requires a key list to be used on this file.

This was possible with OPNQRYF using OPM RPG.  Have they taken it
away with RPG IV?  I use SQL almost exclusively now so I haven't run
into this yet...

>10.  PREFIX(M2:2) is wonderful.  I can't tell you how may people asked
[snip]
>     PREFIX(M2:2:*SUFFIX) to replace the last 2 non-blank characters
>
>     or PREFIX(M2:0:*SUFFIX) to add the suffix after the last non-blank
>     character.  

This would be another good one.  How 'bout just SUFFIX(M2:2), etc.
instead of PREFIX(M2:2:*SUFFIX), etc.
 
>11.  You support multiple overlaying arrays.  That is an absolutely
>     wonderful and extermely powerful function.  I can't tell you
>     how many people asked in the RPG IV seminars I have done whether
>     we can now specify more than one alternate table or array.

I ran into this myself last week--I needed 3 alternate compile-time
arrays.  You can already do this with execution-time arrays...

>13.  We have ITER and LEAVE to exit a do loop.  How do we exit a
>     subroutine without doing a GOTO.  What above an operation code
>     to GOTO *ENDSR just like ITER does a GOTO ENDO and LEAVE does
>     a GOTO ENDO+1.  I have no idea what to call the op code.  I
>     just know we desparately need it.  (This should be trivial -
>     please fix it.)

I like this one, too.  My vote is for an EXIT opcode to immediately
branch to the ENDSR.  Only valid in a subroutine, it would eliminate
the need for a (unique) tag name on the ENDSR statement, and would
precisely indicate that a branch to the ENDSR is occurring.  "GOTO
tag" where "tag" is at the ENDSR is less exact in that you don't
automatically know that the tag is at the ENDSR, and you have to have
a unique tag name for each subroutine. 



------------------------------
Greg Thielen
Magellan Software, Inc.
Home:   gregt@isda.com
Office: gthielen@magsoft.com
        http://www.magsoft.com


root
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
* should be directed to the list owner / operator: david@midrange.com   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.