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



Not sure exactly what you are trying to achieve but a couple of options
may be

- Use sflsiz = sflpag and then you can condition fields on the subfile
row.


- Define the subfile record as a single field at the appropriate length
for the display size you are using and then define different data
structures for each record type. Populate the data structure with the
required data and then move into your subfile field and write the subfile
record.


I have used both in the past.


Cheers

Don






From: "Vern Hamberg via RPG400-L" <rpg400-l@xxxxxxxxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Cc: "Vern Hamberg" <vhamberg@xxxxxxxxxxxxxxx>
Date: 21/06/2023 09:40 PM
Subject: Re: Managing one physical file with several subfile record
formats
Sent by: "RPG400-L" <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx>



Hi Dave

Should I assume that your physical file is internally described?
Therefore, you are using fixed format? Free format file descriptions
have to be externally described.

Anyhow, with internal descriptions, we have I-specs with record
identifiers - this is old school, I've not used this for decades, I
think! :) And then there would be indicators, IIRC. Nowadays you can
give names to some indicators, maybe, for this purpose.

I did look at the SFILE keyword documentation -
https://www.ibm.com/docs/en/i/7.3?topic=keywords-sfilerecformatrrnfield#fsfile

- you can see whether there is any way to use variables.

Regards
Vern

On 6/20/2023 9:42 AM, Dave wrote:
Thanks, that's how we always did it!!

I was wondering if I would end up having to do something like
when sfl010,
when sfl020,

for all my read, writes and exfmt or is there anything in the file
definition specifications that would let me have the format name in a
variable.



- *Subject*: RE: Managing one physical file with several subfile
record
formats
- *From*: "Sean Courtney" <scourtney@xxxxxxxxxxx>
- *Date*: Tue, 20 Jun 2023 09:33:21 +0200

------------------------------
Hello,

You just need to add SFILE for each subfile :

workstn infsr(*pssr)
sfile(sfl010:sn10##)
sfile(sfl020:sn20##)

Kind regards

Seán






On Tue, 20 Jun 2023 at 09:20, Dave <dfx1@xxxxxxxxxxxxxx> wrote:

Hello,

I don't think it's possible to do this but I'm very much outdated and
maybe there's something that can help :

FMYFILE CF E WORKSTN
F SFILE(MySFRecord:SFRRN)

MYFILE is the name of the display file, but MySFRecord would be
variable.

I have a simple program that reads records from a flat physical file
into
a subfile, manages these and updates the physical file from them.

Now I need to add different subfile record formats and do the same,
still
managing the same physical file.


Thanks



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.