Comments on: RPG/400 number of Records present in a physical file using file information data structurehttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/
Sun, 02 Aug 2015 08:47:57 +0000hourly1By: philpl1jbhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80588
Thu, 19 Aug 2010 23:00:02 +0000#comment-80588Not done yet. If your only purpose was to determine how many records were in the file, then the CL command RTVMBRD would be better.

If you aren’t using the file then the IP requires the program to read all the records, as you discovered. You could reduce the work with an *INLR in the mainline or by opening the file as IF which in RPG/400 requires a read, although it doesn’t have to be in the code that’s processed.

]]>By: kalyhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80557
Thu, 19 Aug 2010 15:24:12 +0000#comment-80557philp sir i excluded *inlr and gave the things i want to display within *inzsr it gives correct output i have given the coding below please kindly tell if it is correct or we can code like this sir.i have declared as primary file only but not given *inlr

]]>By: kalyhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80556
Thu, 19 Aug 2010 15:15:25 +0000#comment-80556everyone thanks for your answers.
Pdraebel sir i should not use READ because its an input operation no
i need to display the number of records without using any input operations
]]>By: pdraebelhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80553
Thu, 19 Aug 2010 10:06:50 +0000#comment-80553If you only need to know the number of records use a file Input Full Procedural and UC (user controlled)
FINPUT IF F 128 DISK UC
F KINFDS INFINP
IINPUT NS 01
*
* File information data structure
*
IINFINP DS
I 1 256 IO0001
I 257 400 IO0002
I 83 92 FILE
I 93 102 LIBR
I 129 138 MEMBER
I *RECORD RECFMT
I B 156 1590RECORD
Include a “Dummy” Open and Read (to get Compiled)
*INLR IFNE *INLR
OPEN INPUT
READ INPUT 99
END
With the INFDS coded you can display the number of records easily.
Do an OVERRIDE of INPUT to the file name whose recordnumber needs to be displayed.
]]>By: tomliottahttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80545
Thu, 19 Aug 2010 06:31:04 +0000#comment-80545…is there any equivalent in RPG400…

The ILE reference manuals are available as web pages. The old compiler manuals are only available as .PDF downloads. You can find all RPG manuals from the Programming: RPG page for your version of the operating system.

The RPG/400 manuals aren’t available as web pages because you shouldn’t be using it. Convert the programs to RPG IV. Everyone is forgetting how RPG III works. IBM has not been enhancing it for years. It cannot process many features that have been added to the system in the past ten years.

Tom

]]>By: philpl1jbhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80527
Thu, 19 Aug 2010 00:09:14 +0000#comment-80527Actually, I think it’s the RPG/400 Reference Manual.
Phil
]]>By: philpl1jbhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80521
Wed, 18 Aug 2010 23:29:33 +0000#comment-80521Wow, so many questions
Don’t know if I can answer them all.
I haven’t written in RPG/400 in 10 years and never used IP files..I find that the complexity of the problem requires control that I don’t feel I would have with IP.

Anyway. Put things that you want done once before the cycle starts up in the subroutine *INZSR. Don’t code an *INLR if you want the program to automatically access all the records in the file, after it’s done it will turn on the *INLR for you.

Input prompts for I specs, maybe IPJ and IPJX, when you move up to RPG/IV or LE you will rarely use I specs. The D spec is so much more.

Finally, Google RPG/400 Programmer’s Manual. You will want to have that available at all times.
Phil

]]>By: kalyhttp://itknowledgeexchange.techtarget.com/itanswers/rpg400-number-of-records-present-in-a-physical-file-using-file-information-data-structure/#comment-80495
Wed, 18 Aug 2010 12:31:30 +0000#comment-80495also on I specifications if i give IPDS in starting over the numbers in left side end and prompt i get