.st0{fill:#FFFFFF;}

When the RPGLE %EOF BIF is not the End of File 

 December 15, 2008

By  NickLitten

I love the %EOF code – it just makes me feel less like a Stegasaurus when coding with an indicator.

I was a little disturbed by the fact that %EOF{(file_name)} was the standard but sometimes you can get away with dropping the file_name and sometimes you cant.

This snippet clears it up:

%EOF returns ‘1’ if the most recent read operation or write to a subfile ended in an end of file or beginning of file condition; otherwise, it returns ‘0’.

The operations that set %EOF are:

The following operations, if successful, set %EOF(filename) off. If the operation is not successful, %EOF(filename) is not changed. %EOF with no parameter is not changed by these operations.

When a full-procedural file is specified, this function returns ‘1’ if the previous operation in the list above, for the specified file, resulted in an end of file or beginning of file condition. For primary and secondary files, %EOF is available only if the file name is specified. It is set to ‘1’ if the most recent input operation during *GETIN processing resulted in an end of file or beginning of file condition. Otherwise, it returns ‘0’.

This function is allowed for input, update, and record-address files; and for display files allowing WRITE to subfile records.

So basically – just use %EOF(filename) folks šŸ˜‰

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

Iā€™m always looking for awesome input, feedback and critique!

>