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



Found the solution

INFDS File Feedback Example - IBM Documentation
<https://www.ibm.com/docs/en/i/7.4?topic=information-infds-file-feedback-example>

FREE FORMAT

DCL-F MYFILE DISK(*EXT) INFDS(FILEFBK); DCL-DS FILEFBK; FILE *FILE; // File
name OPEN_IND IND POS(9); // File open? EOF_IND IND POS(10: // File at eof?
STATUS *STATUS; // Status code OPCODE *OPCODE; // Last opcode ROUTINE
*ROUTINE; // RPG Routine LIST_NUM CHAR(8) POS(30); // Listing line
SPCL_STAT ZONED(5) POS(38); // SPECIAL status RECORD *RECORD; // Record
name MSGID CHAR(7) POS(46); // Error MSGID SCREEN *SIZE; // Screen size
NLS_IN *INP; // NLS Input? NLS_OUT *OUT; // NLS Output? NLS_MODE *MODE; //
NLS Mode? END-DS;

On Fri, Jun 30, 2023 at 2:06 AM Thomas Burrows <
thomas.burrows.1957@xxxxxxxxx> wrote:

DCL-F MYFILE DISK(*EXT) INFDS(FILEFBK); DCL-DS FILEFBK; FILE *FILE; //
File name OPEN_IND IND POS(9); // File open? EOF_IND IND POS(10: // File at
eof? STATUS *STATUS; // Status code OPCODE *OPCODE; // Last opcode ROUTINE
*ROUTINE; // RPG Routine LIST_NUM CHAR(8) POS(30); // Listing line
SPCL_STAT ZONED(5) POS(38); // SPECIAL status RECORD *RECORD; // Record
name MSGID CHAR(7) POS(46); // Error MSGID SCREEN *SIZE; // Screen size
NLS_IN *INP; // NLS Input? NLS_OUT *OUT; // NLS Output? NLS_MODE *MODE; //
NLS Mode? END-DS;

On Fri, Jun 30, 2023 at 1:00 AM Thomas Burrows <
thomas.burrows.1957@xxxxxxxxx> wrote:


- Using INFDS with INFSR to catch file exception in RPG AS400
<https://www.as400andsqltricks.com/2021/12/Using%20INFDS%20with%20INFSR%20catch%20file%20exception%20in%20RPGLE.html>

I am trying to put in INFSR just to prove I can do it.
Not sure about the "D File *file"

D FILE
*FILE * File name

D OPEN_IND 9 9N
* File open

D EOF_IND 10
10N * File at eof

D STATUS
*STATUS * Status code

D OPCODE
*OPCODE * Last opcode

D ROUTINE
*ROUTINE * RPG Routine

D LIST_NUM 30
37 * Listing line

D SPCL_STAT 38 42S
0 * SPECIAL status

D RECORD
*RECORD * Record name

D MSGID 46 52
* Error MSGID

D SCREEN
*SIZE * Screen size

D NLS_IN
*INP * NLS Input

D NLS_OUT
*OUT * NLS Output

D NLS_MODE
*MODE * NLS Mode?
Here is what I have in my code.

dcl-f SFL004DF workstn infds(Info) Sfile(Sfl1:Rrn1)
Sfile(Sfl2: Rrn2);

dcl-ds info;
list_num char(07) pos(30);
spcl_stat packed(4:0) pos(38);
msgid char(07) pos(46);
Cfkey char(01) pos(369);
open_ind ??(9:9);
eof_ind ??(9:9);
statue *status;
optcode *optcode;
routine *routine;
record *record;
screen *size;
nls_in *input;
nls_out *output;
nls_mode *mode;
end-ds;


33 dcl-ds info;

34 list_num char(07) pos(30);

35 spcl_stat packed(4:0) pos(38);

36 msgid char(07) pos(46);

37 Cfkey char(01) pos(369);

38 open_ind ind(9:9);

==> abcde

3308 20 a 003800 Keyword name is not valid; the keyword is
ignored.
39 eof_ind ind(9:9);
==> abcde
3308 20 a 003900 Keyword name is not valid; the keyword is ignored.
same error twice. I know that

45 nls_in *input;
==> aaaaaa
3308 20 a 004500 Keyword name is not valid; the keyword is ignored.


46 nls_out *output;

==> aaaaaaa

3308 20 a 004600 Keyword name is not valid; the keyword is
ignored.
47 nls_mode *mode;

48 end-ds;


If anyone wants to look at the code on PUB400.COM

user profile is COBOLKID
pw bear1963

library is cobolkid1

and in QRPGLESRC member SFL004RG

Original code is from Kevin Vandever. But I am going through and
converting the F and D specs to free format.

And want to add some error routine ability.

Not finding any examples on the internet of free format for

dcl-f SFL004DF workstn infds(Info) Sfile(Sfl1:Rrn1)
Sfile(Sfl2: Rrn2);


Will not even go into if the MONITOR command is a better way to go. Which
I think might be the way, but I want to solve the problem both ways.



Thomas



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.