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



I see this conversation going in two directions. First of all, there is the
question of using PREFIX. This renames the fields in the input file. Then
there is mention of using a DS for input/output. These are two separate
issues, and it sounds like the PREFIX stuff is covered sufficiently by
others. Regarding using a DS for DSPF i/o, I was curious myself, so I made a
simple program that illustrates the use of data structures for DSPF i/o.
There are two caveats that I can see with this. First of all, you need an
input DS and an output DS, if there are fields that your program needs to
change (indicators, etc). Second of all, you can't use EXFMT, and have the
data from the screen be read into a DS. You must use WRITE, then READ. I,
for one, would forego the slight (non-noticeable) increase in performance
and use PREFIX, but if you want to use DSs, here is an example:

DSPF BCXMB:
A CA03
A CA12
A R RBCXMB
A 2 68DATE
A EDTCDE(Y)
A COLOR(GRN)
A 3 70TIME
A COLOR(GRN)
A 2 26' Batches with Missing Coders '
A COLOR(WHT)
A DSPATR(RI)
A 91 8 21'--->'
A 91 COLOR(RED)
A 8 26'Site ID............'
A COLOR(GRN)
A BCXACRO 3A B 8 46COLOR(GRN)
A 91 DSPATR(RI)
A 24 23'Enter=Continue F3=Exit F12=Cancel'
A COLOR(GRN)

PGM TESTDSPF:
FBcxmb CF E WorkStn ExtFile('DMART/BCXMB')
F InfDS(WSDS)

D WSDS DS
D FKey 369 369A

D Bcxi DS LikeRec(RBCXMB:*Input) Inz
D Bcxo DS LikeRec(RBCXMB:*Output) Inz

/Free
*InLR=*On;

Write Rbcxmb Bcxo;
Read Rbcxmb Bcxi;

Return;
/End-Free

On 9/23/05, Yivi <nardus@xxxxxxxxx> wrote:
>
> Hi there.
>
> I am trying to use the PREFIX keyword on a file definition to put all the
> fields in a DS, but the the compiler isn't in a very agreeable mood.
>
> In my program:
>
> FALFOFPANT CF E WORKSTN SFILE(LISTADO:RRN)
> F INDDS(I)
> F PREFIX('SCRN')
>
> And then:
> D SCRN E DS EXTNAME(ALFOFPANT) QUALIFIED
>
> I am doing the same thing with my other files, and everything is working
> as
> it should. But attempting to do so with ALFOFPANT results in a myriad of
> errors.
>
> Are display files compatible with the PREFIX keyword? I can't find nothing
> that says otherwise in the documentation, but maybe I am missing
> something...
>
> Thanks,
> Regards,
>
> I.-
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>


--
"Enter any 11-digit prime number to continue..."
"In Hebrew SQL, how do you use right() and left()?..." - Random Thought
"If all you have is a hammer, all your problems begin to look like nails"

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.