|
When you condition a file on an external switch (U1-U8), reads and writes to the file are ignored if the external switch is not on. So you don't have to condition the output with the external switch. Having said this, I haven't used external switches since the System/36. It is far more self-documenting to pass a meaningful parm from the CL program to the RPG program to have the RPG program conditionally open the file in the *INZSR subroutine. Reads and writes to the file can be conditioned on an IF %OPEN(FILE). Charles L.Massoglia, President Massoglia Technical Consulting, Inc. cmassoglia@voyager.net In MI 517-676-9700 or in NC 919-363-9395 ----- Original Message ----- From: "Booth Martin" <booth@MartinVT.com> To: <rpg400-l@midrange.com> Sent: Friday, 01 March, 2002 13:52 Subject: Re: Output to File vs. Report > Another choice is to use U1 - U8 instead of UC. Set U1-U8 in the CL that > calls the program though because the external switches need to be set before > the program opens or it won't realize the switches are on. Condition your > output with the external switches. > > > -------------------------------------------- > Booth Martin > MartinB@Goddard.edu > 802-454-8315 x235 > -------------------------------------------- > -------Original Message------- > > From: rpg400-l@midrange.com > Date: Friday, March 01, 2002 01:38:54 PM > To: rpg400-l@midrange.com > Subject: Output to File vs. Report > > I have some old code that uses the cycle. I need to modify this program to > output to a file or print based on the users selection. Both file and > qsysprt are user controlled (UC). > > I have the code in place for doing a WRITE to the file. Here's my problem.. > The cycle is attempting to write to qsysprt even though it's close. <DUMB > QUESTION> Do I need to turn on an indicator when user requests the output > file and then add "N99" to my output specs? </DUMB QUESTION> > > Any solutions would be greatly appreciated...! > > > > ______________________________________________ > -- > [ Content of type unknown/unknown deleted ] > -- > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.