× 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.



Hi Tim,

[SNIP]
> (PDM/SEU allows either of these)
> D ScRecd        E DS  ExtName(SrcCst:SrcCstR:*Output) Inz
> D                     Qualified
>       ...or...
> D ScRecd        E DS  ExtName(SrcCst:*Output) Inz
> D                     Qualified


These won't help, you need to use LIKEREC() if you're going to use it on a
file operation.


[SNIP]
> (PDM/SEU does NOT allow these)
> D ScRecd        E DS  LikeRec(SrcCst:SrcCstR:*Output) Inz
> D                     Qualified
>       The LIKEDS keyword is not valid with an externally-described
> data structure.
>       (What LIKEDS ????)


The message is wrong, but if you substitute "LIKEREC" where it says
"LIKEDS" then the message will be correct.

You see, LIKEREC must match the record buffer layout that RPG is using
(which can be different than the record layout in the file itself,
especially if there are fields that are defined as input only or output
only)

You also cannot specify "qualified" with LIKEREC.  A LIKEREC structure is
always qualified, so the keyword has no meaning.

You cannot specify a filename with LIKEREC -- only an externally defined
record format name.  Since the same record format name cannot exist twice
in an RPG program, when it knows the record format name it'll also know
the filename.

So, change your definition to look like the following, and it should work:

     D ScRecd          DS                  LIKEREC(SrcCstR:*OUTPUT)


>
> D ScRecd        E DS  LikeDS(SrcCst:SrcCstR:*Output) Inz
> D                     Qualified
>       The LIKEDS keyword is not valid with an externally-described
> data structure.


LikeDS defines one data structure as being the same as another data
structure.  Specifying the "E" for external makes absolutely no sense.
Specifying a filename/recordformat/*output makes absolutely no sense.


> D ScRecd          DS  LikeDS(SrcCst:SrcCstR:*Output) Inz
> D                     Qualified
>       A right parenthesis is expected but is not found.
>       (To match with what ????)


from the manual: "LIKEDS(data_structure_name)."  (You said you read the
manual, right?)  It says nothing about including a filename or record
format name or "*output."

Since there is only one parameter allowed to LIKEDS() when it reaches the
colon, it complains "Hey Tim!  I'm not supposed to find a colon here!  I'm
supposed to find a right-parenthesis!"



> D ScRecd          DS  LikeDS(SrcCst:*Output) Inz
> D                     Qualified
>       A right parenthesis is expected but is not found.
>       (To match with what ????)

Same issue.  I'm sure that you get the idea, so I won't go on.

At any rate, it's the LIKEREC keyword that you want, just specify it
correctly and you'll be set ;)

The following is a trivial example program:

FITMMAST   IF A E           K DISK

D BEFORE          DS                  LIKEREC(ITMMASTF:*INPUT)  INZ
D AFTER           DS                  LIKEREC(ITMMASTF:*OUTPUT) INZ

 /free

     // copy an item, changing only the item number and description:

     chain myItem ITMMASTF before;
     after = before;
     after.Item = myNewItem;
     after.Desc = myNewDescription;
     write ITMMASTF after;

     *inlr = *on;

 /end-free



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.