|
When you want to select which file to open during execution of an ILE RPG program, you can use the ExtFile keyword. The following code snippet provides the gist of how this works: .*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+ FSales UF E K DISK ExtFile( SalesFile ) F UsrOpn . . . D SalesFile S 21A . . . C Eval SalesFile = âAPPDTA/SALES01â C Open (E) Sales The file you specify must exist when you compile the program Be sure to use all uppercase for standard OS/400 file names. The effect in this example is comparable to executing the following command prior to opening the file: OvrDbf File( Sales ) ToFile( AppDta/Sales01 ) Thank you, Karen Hodge Senior System Analyst Genesys Health System 1000 Healthpark Blvd, Grand Blanc, Mi 48439 Office 810.606.5180, Fax 810.606.7204 khodge@xxxxxxxxxxx rpg400-l-request@ midrange.com Sent by: To rpg400-l-bounces@ rpg400-l@xxxxxxxxxxxx midrange.com cc Subject 02/11/2005 12:44 RPG400-L Digest, Vol 4, Issue 187 PM Please respond to rpg400-l@midrange .com Send RPG400-L mailing list submissions to rpg400-l@xxxxxxxxxxxx To subscribe or unsubscribe via the World Wide Web, visit http://lists.midrange.com/mailman/listinfo/rpg400-l or, via email, send a message with subject or body 'help' to rpg400-l-request@xxxxxxxxxxxx You can reach the person managing the list at rpg400-l-owner@xxxxxxxxxxxx When replying, please edit your Subject line so it is more specific than "Re: Contents of RPG400-L digest..." Today's Topics: 1. Re: How to detect what program triggered the trigger? (Scott Klement) 2. Re: external file ds (Booth Martin) 3. RE: How to detect what program triggered the trigger? (Wilt, Charles) 4. RE: external file ds (Wilt, Charles) 5. RE: external file ds (SRamanujan@xxxxxxxxxxxxxxxxxx) 6. RE: sqlrpgle & copy book (Rick.Chevalier@xxxxxxxxxxxxxxx) 7. Re: sqlrpgle & copy book (rob@xxxxxxxxx) 8. RE: sqlrpgle & copy book (rob@xxxxxxxxx) ---------------------------------------------------------------------- message: 1 date: Fri, 11 Feb 2005 11:10:48 -0600 (CST) from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> subject: Re: How to detect what program triggered the trigger? > Is there a way, to detect inside of a trigger program, what program > actually triggered the trigger? I looked in the PSDS but didn't see > anything readily apparent. Positions 334-343 of psds return the name of > the trigger program itself. A trigger is a normal program that gets called by the database manager. The PSDS won't behave differently in a trigger -- it'll still have the name of the program itself (not the name of who called it) in those positions. Just like it always does. > What I want to do is assign a trigger *AFTER *READ that will identify > inside the trigger program the program that performed the read event. There's an entry in the Midrange.com FAQ that discusses this topic: http://faq.midrange.com/data/cache/95.html The FAQ entry is written in CL, but I converted it to RPG in an article that I wrote for my newsletter. You can find my version at the following link (requires a free "Associate" membership to the iSeries Network): http://www.iseriesnetwork.com/article.cfm?ID=19026 You might also consider searching the archives of the mailing list. ------------------------------ message: 2 date: Fri, 11 Feb 2005 11:12:05 -0600 (Central Standard Time) from: "Booth Martin" <booth@xxxxxxxxxxxx> subject: Re: external file ds I believe the D-specs need a name that the compiler can use to find the field definitions. Therefore it can not be a variable. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 02/11/05 10:51:14 To: rpg400-l@xxxxxxxxxxxx Subject: external file ds All, I have another question. Is there any way to parameterize the extname(<filename>)? For instance : d slotDS e ds extname( hearslots ) The hearlots be a variable which can take any value? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. . ------------------------------ message: 3 date: Fri, 11 Feb 2005 12:11:09 -0500 from: "Wilt, Charles" <CWilt@xxxxxxxxxxxx> subject: RE: How to detect what program triggered the trigger? Basically, You have to send a message up the program stack and retrieve it. There's been a couple of articles written that show how to do this. iSeries Network had one titled "Give your Trigger programs Caller ID" or something to that effect. You may try searching the archives here too. Charles Wilt iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of > GKern@xxxxxxxxxxxxxxxx > Sent: Friday, February 11, 2005 11:46 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: How to detect what program triggered the trigger? > > > Is there a way, to detect inside of a trigger program, what program > actually triggered the trigger? I looked in the PSDS but didn't see > anything readily apparent. Positions 334-343 of psds return > the name of > the trigger program itself. > > What I want to do is assign a trigger *AFTER *READ that will identify > inside the trigger program the program that performed the read event. > > Regards, Jerry > > Gerald Kern > IBM Certified AS/400 RPG IV Developer & RPG IV Programmer > MIS Project Leader, Lotus Notes/Domino Administrator > The Toledo Clinic, Inc. > 4235 Secor Road > Toledo, OH 43623-4299 > Phone 419-479-5535 > gkern@xxxxxxxxxxxxxxxx > > ***** > This email message, including any attachments, is for the > sole use of the intended recipient(s) and may contain > confidential and privileged information. Any unauthorized > review, use, disclosure or distribution is prohibited. If you > are not the intended recipient, please contact the sender by > reply email and destroy all copies of the original message. > ------------------------------ message: 4 date: Fri, 11 Feb 2005 12:16:28 -0500 from: "Wilt, Charles" <CWilt@xxxxxxxxxxxx> subject: RE: external file ds No. Charles Wilt iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of > SRamanujan@xxxxxxxxxxxxxxxxxx > Sent: Friday, February 11, 2005 11:50 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: external file ds > > > All, > I have another question. > Is there any way to parameterize the extname(<filename>)? > > For instance : > > d slotDS e ds extname( hearslots ) > > The hearlots be a variable which can take any value? > > Thanks, > Sudha > > Sudha Ramanujan > SunGard Futures Systems > sramanujan@xxxxxxxxxxxxxxxxxx > (312) 577 6179 > (312) 577 6101 - Fax > > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) > mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > ------------------------------ message: 5 date: Fri, 11 Feb 2005 11:26:22 -0600 from: <SRamanujan@xxxxxxxxxxxxxxxxxx> subject: RE: external file ds Thanks all. -s Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: Booth Martin [mailto:booth@xxxxxxxxxxxx] Sent: Friday, February 11, 2005 11:12 AM To: RPG programming on the AS400 / iSeries Subject: Re: external file ds I believe the D-specs need a name that the compiler can use to find the field definitions. Therefore it can not be a variable. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 02/11/05 10:51:14 To: rpg400-l@xxxxxxxxxxxx Subject: external file ds All, I have another question. Is there any way to parameterize the extname(<filename>)? For instance : d slotDS e ds extname( hearslots ) The hearlots be a variable which can take any value? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. . -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. ------------------------------ message: 6 date: Fri, 11 Feb 2005 11:30:13 -0600 from: <Rick.Chevalier@xxxxxxxxxxxxxxx> subject: RE: sqlrpgle & copy book I thought someone did this, I just couldn't remember who. I haven't tried in a while so it was probably something I did wrong at the time. Thanks for correcting that. Rick -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joel Cochran Sent: Friday, February 11, 2005 4:43 AM To: RPG programming on the AS400 / iSeries Subject: RE: sqlrpgle & copy book On Fri, 2005-02-11 at 14:08, Rick.Chevalier@xxxxxxxxxxxxxxx wrote: > Also make sure the sub fields are defined in your copybook. I have not been able to use externally defined data structures as result sets for embedded SQL. The compiler always complains they aren't defined or usable. I use externally defined DS all the time for SQL: d slotDS e ds extname( hearslots ) c/exec SQL c+ Select * c+ into :slotDS c+ from HEARSLOTS c/end-exec Code is running at V5R1. Could it be that this doesn't function well inside a /copy? Maybe try /include instead? Joel Cochran http://www.rpgnext.com Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain legally privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. ------------------------------ message: 7 date: Fri, 11 Feb 2005 12:40:19 -0500 from: rob@xxxxxxxxx subject: Re: sqlrpgle & copy book Gina, Thank you for your reply. And I am sorry that I keep forgetting that part of it. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com Gina M Whitney <whitneyg@xxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/11/2005 11:37 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To rpg400-l@xxxxxxxxxxxx cc Subject sqlrpgle & copy book Are you getting the SQL0312 for fields? You defined your data structure as fieldDs. dfieldDs ds d field1 5a d field2 15p 2 d field3 30a c/exec sql fetch next from c into :fields :myNullAry c/end-exec In V5R3, there is a new parameter called RPGPPOPT: RPG preprocessor options (RPGPPOPT) - Help Specifies if the RPG compiler will be called to preprocess the source member before the SQL precompile is run. Preprocessing the SQL source member will allow some compiler directives to be handled before the SQL precompile. The preprocessed source will be placed in file QSQLPRE in QTEMP. This source will be used for the SQL precompile. *NONE The compiler is not called for preprocessing. *LVL1 The compiler is called for preprocessing to expand /COPY and handle the conditional compilation directives except the /INCLUDE directive. *LVL2 The compiler will be called for preprocessing to expand /COPY and /INCLUDE and handle the conditional compilation directives. So with *NONE, which is the default, the precompiler can handle one level of /Copy and does not read /INCLUDE. Another common reason for getting SQL0312 is that you have the host variable defined more than once. The precompiler never has handled scoping of variables and requires all variables to be unique, even if they are in different procedure. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. ------------------------------ message: 8 date: Fri, 11 Feb 2005 12:43:53 -0500 from: rob@xxxxxxxxx subject: RE: sqlrpgle & copy book http://www-912.ibm.com/ Select "Software Service Request" Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com <SRamanujan@xxxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/11/2005 11:16 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To <rpg400-l@xxxxxxxxxxxx> cc Subject RE: sqlrpgle & copy book Thanks Rob. How do I open a pmr? Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: rob@xxxxxxxxx [mailto:rob@xxxxxxxxx] Sent: Friday, February 11, 2005 10:00 AM To: RPG programming on the AS400 / iSeries Subject: RE: sqlrpgle & copy book Actually in this case I think he DOES want a /copy instead of a /include, if he is running prior to V5R3. Prior to V5R3 the precompiler ignored /include but did /copy. You need the precompiler to actually do the /copy to get it to use the fields within the data structure. In the V5R3 version of the precompiler supposedly they fixed all bad issues regarding /copy (like nested copies now work). And they now treat /include just like /copy. Which I think is asinine because the sole purpose of /include was to be ignored by the precompiler. When they come up with yet another function that is not valid within the precompiler what will the compiler team do? Come up with a /copyifnotinsqlprecompiler directive? Or is there an new conditional compilation directive that should be used? Obviously this is not his issue since he tried both directives though. Odd that it works if neither is used, but a physical copy is used instead. Open a pmr. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com <SRamanujan@xxxxxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 02/11/2005 10:26 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To <rpg400-l@xxxxxxxxxxxx> cc Subject RE: sqlrpgle & copy book Ok I checked the Archives and found to use /include instead of /copy but I still get the error SQL0312 'Fields is not defined or not usable'. What am I doing wrong. My code looks now as: Rpgle.myds dfieldDs ds d field1 5a d field2 15p 2 d field3 30a sqlrpgle : /include rpgle,myds * d myDsNullI ds d based(myDsNullAd) d myNullAry 5i 0 dim(21) c/exec sql declare c cursor for select * from filea for read only c/end-exec c/exec sql open c c/end-exec c/exec sql fetch next from c into :fields :myNullAry c/end-exec c/exec sql close c c/end-exec Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: Rick.Chevalier@xxxxxxxxxxxxxxx [mailto:Rick.Chevalier@xxxxxxxxxxxxxxx] Sent: Friday, February 11, 2005 8:08 AM To: rpg400-l@xxxxxxxxxxxx Subject: RE: sqlrpgle & copy book Also make sure the sub fields are defined in your copybook. I have not been able to use externally defined data structures as result sets for embedded SQL. The compiler always complains they aren't defined or usable. I vaguely remember someone posting to this list that they got embedded SQL to work using an externally described DS as the result set but I may be mistaken. Check the archives, this has been discussed several times before. Rick -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of SRamanujan@xxxxxxxxxxxxxxxxxx Sent: Thursday, February 10, 2005 4:32 PM To: rpg400-l@xxxxxxxxxxxx Subject: sqlrpgle & copy book Hi all, When I have a copy book that has the data structure, and fetch into the ds, I get a sql pre-compiler error SQL0312 'The DSNAME is not define or not usable' Is there anyway to avoid this? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain legally privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. ------------------------------ -- This is the RPG programming on the AS400 / iSeries (RPG400-L) digest list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. End of RPG400-L Digest, Vol 4, Issue 187 ****************************************
As an Amazon Associate we earn from qualifying purchases.
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.