× 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 was going to respond that Vern's reaction was the same as my first thought.

I can think of a use where you have some generic utility that dumps a lot of various data into a simple flat file and the program has to deal with it - maybe soft coding columns and data types from SYSCOLUMNS or such.
Pretty far out there but still a possibility.

Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Peter Dow
Sent: Wednesday, June 21, 2023 11:18 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Managing one physical file with several subfile record formats

I know what you mean - I'd have a really hard time coming up with a use
case for it.

On 6/21/2023 10:15 AM, VERNON HAMBERG Owner via RPG400-L wrote:
Thanks, Peter - I was thinking of the default, which is *EXT - have never used record length in free-format - almost pathologically opposed to the idea!! :)


Regards
Vern


On Wed, 21 Jun, 2023 at 12:07 PM, Peter Dow<petercdow@xxxxxxxxx> wrote:


To:rpg400-l@xxxxxxxxxxxxxxxxxx

Hi Vern,

"Free format file descriptions have to be externally described." doesn't
match the manual. I haven't done it, but you should be able to define a
program-described file in free format with something like

dcl-f myFile disk(200);

The caveat is you would have to do I/O with a data structure, e.g.

chain (search-arg) myFile myDataStruc;

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx<mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx<mailto:pdow@xxxxxxxxxxxxxx> '/

On 6/21/2023 4:40 AM, Vern Hamberg via RPG400-L wrote:
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<mailto: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

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


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.