|
Not except by using a pointer but why would you want to? Simply call a procedure to load an internal structure and return a count. Then code a procedure to get one record at a time in a loop and process. That would be ILE. Returning the entire structure would be monolith. Also, I would recommend some form of a dynamic structure in your load procedure. Declaring a data structure with that many occurrences is going to chew up a lot of memory and I will bet most of the time you are not going to use a fraction of it. Again my trigger mediator, but if you take a look at service program XVERRH, it has code to store and retrieve message details as part of it, all done dynamically. Available at www.think400.dk in downloads. Just pull out the XVERRH part. -----Original Message----- From: PAPWORTH Paul [mailto:Paul.Papworth@xxxxxxx] Sent: Monday, July 04, 2005 8:47 AM To: rpg400-l@xxxxxxxxxxxx Subject: Multi Occurence Data Structure returned from a procedure Is it possible to declare a multi occurrence data strucuture as the return value from a procedure in a RPG/COBOL program. Eg Msg_dets = get_table_date ; d msg_dets ds occurs(100) d msgid 7a d msgsev 2s 0 d msgfirst 122a d msgsecnd 100a d* Thanks in advance for any help -----Message d'origine----- De : rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de rpg400-l-request@xxxxxxxxxxxx Envoyé : lundi 27 juin 2005 16:02 À : rpg400-l@xxxxxxxxxxxx Objet : RPG400-L Digest, Vol 4, Issue 732 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: AW: Putting Leading Zeros in Sql ? (Carel Teijgeler) 2. Re: Update a spreadsheet with data from iSeries (Booth Martin) 3. Re: Resistance to change (was free format question) (James H. H. Lampert) 4. Re: AW: Putting Leading Zeros in Sql ? (Hauser, Birgitta) 5. RE: heterogeneous connectivity through AS400 Sql? (Wilt, Charles) 6. RE: Auto-eject Printouts (Brian Piotrowski) 7. Re: heterogeneous connectivity through AS400 Sql? (Paul Morgan) 8. Re: heterogeneous connectivity through AS400 Sql? (David Gibbs) ---------------------------------------------------------------------- message: 1 date: Sun, 26 Jun 2005 22:24:39 +0200 from: "Carel Teijgeler" <coteijgeler@xxxxxxxxx> subject: Re: AW: Putting Leading Zeros in Sql ? Would not the following statement do the same? CHAR(DIGITS(MONTH(CURRENT DATE)),2) Regards, Carel Teijgeler *********** REPLY SEPARATOR *********** On 26-6-05 at 16:33 HauserSSS wrote: >Hi, > >if you use the SQL scalar function MONTH the return value is a numeric >value >and not a character string. >You have to convert the numeric value into a character string and depending >on its length, you add the leading zero or not. > >Select case when month(current_date) < 10 then '0' else '' End > concat Char(Month(Current_Date)) > from sysibm.sysdummy1 > >Birgitta > >-----Ursprngliche Nachricht----- >Von: rpg400-l-bounces@xxxxxxxxxxxx >[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Luqman >Gesendet: Sonntag, 26. Juni 2005 14:35 >An: rpg400-l@xxxxxxxxxxxx >Betreff: Putting Leading Zeros in Sql ? > > >How to put leading zeros in sql ? > >For example: > >if current date is : 1st June 2005 >Select month(current date) from sysibm.sysdummy1 >is returning 6, when I need this to be '06'. > >Any idea please ? > >Best Regards, > >Luqman > > > > >-- >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: 2 date: Sun, 26 Jun 2005 18:33:44 -0500 (Central Standard Time) from: "Booth Martin" <booth@xxxxxxxxxxxx> subject: Re: Update a spreadsheet with data from iSeries I meant that putting known good data into two of the cells is a method to determine the problem. If you insert known good data into two of the cells and the problem disappears for those two cells you'd know it is a data issue. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 06/24/05 17:30:22 To: RPG programming on the AS400 / iSeries Subject: Re: Update a spreadsheet with data from iSeries Will put it on my 'what to do on a sunny saturday' list :-) Btw: Think400.dk/adhoc_2.htm#eks0011 has some examples about 'Centering a string in a field' Leif ----- Original Message ----- From: "Booth Martin" <booth@xxxxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: 24. juni 2005 21:28 Subject: Re: Update a spreadsheet with data from iSeries just for fun, can you put good data in two of the cells? Use upddta or whatever, but see if anything changes. --------------------------------- Booth Martin http://www.martinvt.com -- 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: Mon, 27 Jun 2005 00:28:45 -0700 from: "James H. H. Lampert" <jamesl@xxxxxxxxxxx> subject: Re: Resistance to change (was free format question) Let me put it another way. Consider FORTRAN. You HAVE all at least HEARD of FORTRAN, whether or not you can read it or code it, right? Now consider ANSI-66 FORTRAN IV, as compared with primitive FORTRAN on the one hand, and FORTRAN-77. They're all distinct dialects, with some mutual incompatibilities, but they're all recognizably FORTRAN (unless they're coded for that dreadful CDC free-format FORTRAN "standard"!) Or consider BASIC. It is itself a recognizable derivative of FORTRAN, with greatly simplified syntax, and free formatting of source (but you pay for it with mandatory line numbers, and no way for separately compiled pieces of code to call each other.) Old Dartmouth BASIC, IBM VS-BASIC, DEC BASIC-Plus, Altair BASIC, Radio Shack Level II BASIC, Apple Integer BASIC, Applesoft, PET BASIC, and GW-BASIC are all distinct dialects of BASIC, but they're all recognizably BASIC. Now consider some things that happened some years ago at ETH, mostly by the hands of Niklaus Wirth: He wrote a teaching language, designed to force incorrigibles to write structured code. Indeed, it was so fussy about structure that there were a number of constructs that were perfectly valid from a structured programming standpoint, that couldn't be implemented in this language without either using backdoors (like using a DOWHILE or DOUNTIL loop to do the job of a FOR loop) or violating structured programming rules. But then again, he never intended Pascal as a production language, only as a teaching language. When people started clamoring for a Pascal-like language for production use, he came up with a language that added a lot of new features, particularly aimed at code re-use. Did he call that new language Pascal II? No; he called it Modula, and the most popular implementation of it was his second try, called Modula II. Consider an area outside of HLLs. Consider word processors. WordPerfect was a marvelous word processor, and an industry standard for many years. It was lean, and it ran like the wind even on fairly old, fairly small, fairly slow hardware. But it wasn't a sophisticated typesetting system, and didn't pretend to be: if you wanted that, you got one: PageFaker, if you wanted slickness, or were just jumping on the bandwagon because everybody else was on it (and if everybody else jumped off a cliff . . . ?), or Xerox Ventura Publisher, if you wanted the text to stay in the original word processor file (WordPerfect, Wordstar, MS Word, or whatever), and you wanted the finished document to look like people who knew what they were doing had spent hundreds of hours setting it in real type. Then along comes Microsloth, and decides that the very idea that other companies are making money selling typesetting software offends them. So they start building pseudo-typesetting capability into Word for Windoze. What happens? People stop using separate typesetting applications, and the standard of quality for computer-generated documents (already rather low, thanks to PageFaker) takes a nosedive. I see something similar happening in HLLs: the die-hards who seem to actually believe that their language is truly the one to render all others obsolete set out to remake their respective chosen languages into something they're not. And in the process, the unique strengths of those languages often get cast aside. And you end up with people claiming to be RPG programmers, who don't know what "The Cycle" is, much less how to make productive use of it in ways both conventional and unconventional. More than likely, they also know very little about RPG's file I/O. They end up writing programs that they may as well have been written in Old Dartmouth BASIC, for all the advantage they take of RPG's strengths. Then, too, how many people are pushing ILE, and yet ignoring ILE's greatest strength: the ability to achieve static linkage between modules written in different languages. You don't do that, and you don't even think about using service programs where appropriate, and you may as well go back to OPM. -- James H. H. Lampert Professional Dilettante http://www.hb.quik.com/jamesl http://members.hostedscripts.com/antispam.html http://www.thehungersite.com Help America's Passenger Trains. http://www.saveamtrak.org Read My Lips: No More Atrocities! ------------------------------ message: 4 date: Mon, 27 Jun 2005 12:24:25 +0200 from: "Hauser, Birgitta" <Birgitta.Hauser@xxxxxxxxxxx> subject: Re: AW: Putting Leading Zeros in Sql ? Hi Carel, >>Would not the following statement do the same? >>CHAR(DIGITS(MONTH(CURRENT DATE)), 2) >>Regards, >>Carel Teijgeler The result of your statement will always be '00', because Month() returns an integer value. If you convert an integer with digits the result consists of 10 characters. Char takes the first 2 characters. But the following statement will return the correct month: DIGITS(DEC(MONTH(CURRENT DATE), 2, 0)) Birgitta ------------------------------ message: 5 date: Mon, 27 Jun 2005 07:53:55 -0400 from: "Wilt, Charles" <CWilt@xxxxxxxxxxxx> subject: RE: heterogeneous connectivity through AS400 Sql? Search the archives it has been discussed plenty on times. Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121 > -----Original Message----- > From: rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx > [mailto:rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx]On Behalf Of > Luqman > Sent: Sunday, June 26, 2005 7:58 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: heterogeneous connectivity through AS400 Sql? > > > Is it possible to view Oracle data through AS 400 Sql, like > Linked Server > Option Sql Server and Heterogenous Connectivity Option in > Oracle, without > transferring the data to AS 400. > > Best Regards, > > Luqman > > > > -- > 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: Mon, 27 Jun 2005 07:58:29 -0400 from: "Brian Piotrowski" <bpiotrowski@xxxxxxxxxxxxxxx> subject: RE: Auto-eject Printouts Thanks for the info, everyone. I solved the problem by closing the file and opening it right away as soon as it was closed (I had to do this because it would give me an I/O error if you tried to print again right away). Brian. -----Original Message----- From: Booth Martin [mailto:booth@xxxxxxxxxxxx] Sent: Friday, June 24, 2005 4:28 PM To: RPG programming on the AS400 / iSeries Subject: Re: Auto-eject Printouts You don't need to have the file be user-open. You can close any file any time. Once closed you can open it any time. The user-open keyword is useful when you want to delay the opening of some file until its needed or some other action has occurred. --------------------------------- Booth Martin http://www.martinvt.com --------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: 06/24/05 15:15:03 To: rpg400-l@xxxxxxxxxxxx Subject: Re: Auto-eject Printouts I think you need to do a user-controlled open on your print file and then close it in your program. As long as the file is open, it won't print. Brian Piotrowski wrote: > Hi All, > > > > I have a command that will call the printout routine once the data is > displayed on-screen. However, I'm having an issue in the fact that the > program will not actually print the report until the program is stopped. > > > > Here's my code for the printing feature: > > > > BegSR PrintReport; > > TLOT = GETYM + '-' + GETRRN; > > rdashes = *ALL'-'; > > write HEADING; > > SetGT SEARCHKEY DPKDL_LF; > > ReadP DPKDL_LF; > > Rrn = 1; > > DoW NOT %EOF(DPKDL_LF) and (Rrn <= 9999); > > If PrtOverFlow; > > Write HEADING; > > PrtOverflow = *off; > > endif; > > SUPPLIER = %TRIM(SUPP) + '-' + %TRIM(SUPPLC); > > If ASNQTY = 0; > > ASNAMT = 'N/A'; > > Else; > > ASNAMT = %char(ASNQTY); > > Endif; > > > > If ASNETA ='01/01/2000'; > > ASNDATE = 'N/A'; > > Else; > > ASNDATE = ASNETA; > > Endif; > > > > Write DETAIL; > > ReadP DPKDL_LF; > > Rrn = Rrn + 1; > > EndDo; > > Write pfooter; > > EndSR > > > > What do I need to add to my code to get it to automatically print? > > > > Thanks again! > > > Brian. > > > > > > -=-=-=-=-=-=-=-=-=-=-=-=-=- > > Brian Piotrowski > > Specialist - I.T. > > Simcoe Parts Service, Inc. > > Ph: 705-435-7814 x343 > > Fx: 705-435-6746 > > bpiotrowski@xxxxxxxxxxxxxxx > > -=-=-=-=-=-=-=-=-=-=-=-=-=- > > > -- 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: 7 date: Mon, 27 Jun 2005 09:44:35 -0400 from: "Paul Morgan" <pmorgan@xxxxxxxxxxxxxx> subject: Re: heterogeneous connectivity through AS400 Sql? You can do it directly using Java JDBC. Oracle also has an expensive product that lets you connect using IBM SQL ODBC. This is a good question for a list FAQ. Paul -- Paul Morgan Senior Programmer Analyst - Retail J. Jill Group 100 Birch Pond Drive, PO Box 2009 Tilton, NH 03276-2009 Phone: (603) 266-2117 Fax: (603) 266-2333 Luqman wrote > Is it possible to view Oracle data through AS 400 Sql, like Linked Server > Option Sql Server and Heterogenous Connectivity Option in Oracle, without > transferring the data to AS 400. ------------------------------ message: 8 date: Mon, 27 Jun 2005 08:59:52 -0500 from: David Gibbs <david@xxxxxxxxxxxx> subject: Re: heterogeneous connectivity through AS400 Sql? Luqman wrote: > Is it possible to view Oracle data through AS 400 Sql, like Linked Server > Option Sql Server and Heterogenous Connectivity Option in Oracle, without > transferring the data to AS 400. You might want to check out John Brandt's iS/ODBC product (http://www.istudio400.com/). I've never actually worked with it, but it sounds like it might do what you want. It's not native SQL, but does provide the access. david -- David Gibbs david@xxxxxxxxxxxx Receipt of this message does not grant you permission to send me Unsolicited Commercial Email ------------------------------ -- 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 732 ****************************************
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.