|
Thanks a lot Carel Teijgeler, Hopefully this will definetely solve my purpose. Thanks a lot for your great help.... Jitendra ----- Original Message ---- From: "rpg400-l-request@xxxxxxxxxxxx" <rpg400-l-request@xxxxxxxxxxxx> To: rpg400-l@xxxxxxxxxxxx Sent: Wednesday, 13 December, 2006 4:55:44 AM Subject: RPG400-L Digest, Vol 5, Issue 1366 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..." *** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful. Today's Topics: 1. Re: How I can get the Data of a PF in Printer File (Carel Teijgeler) 2. Re: Using the mouse on Green Screen (Rory Hewitt) 3. Re: RPG400-L Digest, Vol 5, Issue 1365 (mgarton@xxxxxxxxxxxxxxx) 4. RE: Using the mouse on Green Screen (Turnidge, Dave) 5. RE: Does anyone use indicators anymore? (Holden Tommy) 6. RE: Does anyone use indicators anymore? (Lim Hock-Chai) 7. usleep not sleeping - maybe not tired? (albartell) 8. Re: usleep not sleeping - maybe not tired? (Rory Hewitt) 9. RE: usleep not sleeping - maybe not tired? (Joe Pluta) ---------------------------------------------------------------------- message: 1 date: Tue, 12 Dec 2006 21:31:08 +0100 from: "Carel Teijgeler" <coteijgeler@xxxxxxxxx> subject: Re: How I can get the Data of a PF in Printer File Jitendra, If you want to use embedded SQL (or SQLRPG) you have to choose for dynamic SQL. This means you build your SQL statement at runtime and prepare that SQL statement. You start with something like C eval Statement = "SELECT * FROM " + Filename. As each file returns a different result set which you do not know at compile time (or at runtime for that matter) the best solution (IMHO) is to use a SQL descriptor area (SQLDA). The sequence I have used for this (and done this) is: DECLARE CURSOR PREPARE DESCRIBE INTO SQLDA OPEN USING SQLDA FETCH NEXT USING SQLDA CLOSE CURSOR In the SQL Reference manuals you can find information on the SQLDA (searching the web can link you to other good resources of info as well; the use of SQLDA is well explained). The SQLDA exist of an array with each element a definition of a column in the result set. To link an array element with the programme variable it uses a pointer. As the number of columns in the result set or the data type of each column at runtime is not know use DESCRIBE to get that data. The programme variables linked with the SQLDA are elements of a noncontagious array, defined as D Results DS D Resultset 1024 DIM(32) D CharValue 32 OVERLAY(Resultset:1) D PackedValue 30P 9 OVERLAY(Resultset:*NEXT) D ZonedValue 30S 9 OVERLAY(Resultset:*NEXT) The linking with the pointer is done like C eval SQLDTA = %addr(CharValue(SQLIx)) C eval SQLDTA = %addr(PackedValue(SQLIx)) C eval SQLDTA = %addr(ZonedValue(SQLIx)) I would make the SQLRPG programme a *SRVPGM, so you can use it for other reporting purposses as well. Hopefully this answers your questions and did not raise others. Success with your project. Regards, Carel Teijgeler *********** REPLY SEPARATOR *********** On 12-12-2006 at 18:25 Jitendra Bokshe wrote:
But I just want to use Embeded SQL, and I tried for the same but the thing
is that in Embeded SQL we need to define host sturture array.
If I am passing a PF(table name) & Library name as a parameter to RPGLE
program (means Runtime). So how it is possible?
One more doubt is that can we pass the parameter to SELECT Statment??
(Don't slap me if u think that this question is silly) ------------------------------ message: 2 date: Tue, 12 Dec 2006 12:37:15 -0800 from: "Rory Hewitt" <roryhewitt@xxxxxxxxx> subject: Re: Using the mouse on Green Screen Dave, I found this in the DDS manual: "Valid EVENT-IDs are E00 through E15. EVENT-IDs are similar to CAxx keys in that no input data is transmitted from the device." I found this online at http://www.systeminetwork.com/isnetforums/archive/index.php?t-5838.html: "I was able to get it to mostly work, including returning the AID byte for a CFxx/CAxx key if defined as such or returning an AID of x'70' thru x'7F' when defined using an event ID of E00 thru E15, respectively." Rory On 12/12/06, Turnidge, Dave <DTurnidge@xxxxxxxxxxxxxxxxxxxx> wrote:
Before I totally give up on this issue... I would like to know what the "EVENT-ID" is that is able to be used with MOUBTN. One of the samples that I have been given is: MOUBTN(*ULR E00) What is the "E00"? How is it used? I don't see anything helpful in the DDS manual. Thanks, Dave
------------------------------ message: 3 date: Tue, 12 Dec 2006 15:01:13 -0600 from: mgarton@xxxxxxxxxxxxxxx subject: Re: RPG400-L Digest, Vol 5, Issue 1365 Scott, Thanks. I'll check out the articles. What bothers me is this logic has worked for the past couple of years. Just recently did the problem start. Mark message: 3 date: Tue, 12 Dec 2006 12:41:57 -0600 (CST) from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> subject: Re: Socket Server Error - Give Descriptor Error
GiveDescriptor(): The value specified for the argument is not correct.
The following is quoted from the Information Center page for the givedescriptor() API: This error code indicates one of the following: * The target_job parameter points to data that is not valid. * The target_job parameter refers to a job that is not active.
I have this same process running on two systems. It works fine on one system but the listener job will end once or twice a day on the other system.
Consider using the spawn() API instead of the icky givedescriptor() API. Or use inetd and eliminate the bind/listen/accept logic entirely. The following articles describe these techniques. Both articles do require a membership in the System iNetwork to read, but a free ("Associate") membership is sufficient: TCP/IP Server Programming (the example of the spawn() API is in the code download): http://www.systeminetwork.com/article.cfm?id=51809 An Easier Way to Write a TCP/IP Server Program http://www.systeminetwork.com/article.cfm?id=53182 ------------------------------ message: 4 date: Tue, 12 Dec 2006 15:06:52 -0600 from: "Turnidge, Dave" <DTurnidge@xxxxxxxxxxxxxxxxxxxx> subject: RE: Using the mouse on Green Screen Thank you. I will check it out. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rory Hewitt Sent: Tuesday, December 12, 2006 2:37 PM To: RPG programming on the AS400 / iSeries Subject: Re: Using the mouse on Green Screen Dave, I found this in the DDS manual: "Valid EVENT-IDs are E00 through E15. EVENT-IDs are similar to CAxx keys in that no input data is transmitted from the device." I found this online at http://www.systeminetwork.com/isnetforums/archive/index.php?t-5838.html: "I was able to get it to mostly work, including returning the AID byte for a CFxx/CAxx key if defined as such or returning an AID of x'70' thru x'7F' when defined using an event ID of E00 thru E15, respectively." Rory On 12/12/06, Turnidge, Dave <DTurnidge@xxxxxxxxxxxxxxxxxxxx> wrote:
Before I totally give up on this issue... I would like to know what the "EVENT-ID" is that is able to be used with MOUBTN. One of the samples that I have been given is: MOUBTN(*ULR E00) What is the "E00"? How is it used? I don't see anything helpful in the
DDS manual. Thanks, Dave
-- 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: Tue, 12 Dec 2006 15:22:48 -0600 from: "Holden Tommy" <Tommy.Holden@xxxxxxxxxxxxxxxxx> subject: RE: Does anyone use indicators anymore? In your first example: //If ony 0 to 9 is allow, I do below if %check('1234567890' :charFld) > 0; // not a number; Else; // is a number endif; Some actual numerics may fall out since some characters can be part of the field...for instance - or + signs. Thanks, Tommy Holden -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Lim Hock-Chai Sent: Tuesday, December 12, 2006 1:36 PM To: RPG programming on the AS400 / iSeries Subject: RE: Does anyone use indicators anymore? I hate TESTN: - Not supported in Free. - As far as I can remember, it does not recognize decimal point, + and - sign. - Worst of all, you got three different indicator that tells you three different conditions. I usually do one of these two: //If ony 0 to 9 is allow, I do below if %check('1234567890' :charFld) > 0; // not a number; Else; // is a number endif; or //if any numeric notation is allow, I do below: Monitor; dummyInt = %int(%trim(charFld)); on-error; // not a number Endmon; -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck In the end, I took the path that was easiest for me to write. If another programmer needs to maintain this one-timer (they never really are just one-timers, are they?) then I'm not at all sorry that he might have to read up on * report fields that should be numbers but aren't * note that empty (blank) fields are OK TESTN charfld 2020 n20 EXCEPT badCharfld In the end, my comfort with indicators in this context outweighed the distaste for global variables. --buck
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.