From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 01 00:00:43 2005 Date: Fri, 1 Apr 2005 00:00:02 -0500 From: Nathan Stratton Treadway Subject: [sqr-users] Monthly sqr-users Hints Posting sqr-users Mailing List Hints and Guidelines Nathan Stratton Treadway, Ray Ontko & Co. (nathanst@ontko.com) $Revision: 1.21 $ $Date: 2004-03-04 02:47:15-05 $ This document gathers in one location information about the sqr-users mail list. It includes instructions for changing your subscription settings (including unsubscribing), as well are guidelines for using the list. ______________________________________________________________________ Table of Contents 1. Changes Since Previous Version 2. Introduction 2.1 sqr-users Mailing List 2.2 sqr-users Hints and Guidelines Document 2.3 Related Mailing Lists 3. Interacting with the list server 3.1 Subscribing to the list 3.2 Unsubscribing from the list 3.3 When your email address changes 3.4 Digests 3.5 Obtaining your password 3.6 Problems 4. Posting to the sqr-users List 4.1 General Guidelines 4.2 Posting a Message 4.3 Replying to a Message 5. Job Announcements ______________________________________________________________________ 1. Changes Since Previous Version Changes since the version dated 2003/11/01: o Update subscribe/unsubscribe instructions for new version of list server software. o New URL for "brio-l" mailing list. 2. Introduction 2.1. sqr-users Mailing List The sqr-users mailing list was created to enable discussion related to the SQR database language from Hyperion (and to other products in the SQR product suite). Note: SQR used to be published by SQRIBE Technologies, which was merged into Brio Technology on August 3, 1999. Brio Technology changed its name to Brio Software in October 2001. On October 16, 2003, Hyperion acquired Brio Software. SQR and related applications have also been called "Brio.Report" and "Brio Reports". The mailing list is provided as a service of Ray Ontko & Co. A searchable archive of past postings to the mailing list is available from the SQR Users Group web site . 2.2. sqr-users Hints and Guidelines Document This document gives various hints and guidelines about the sqr-users mailing list. It will be posted approximately monthly to the mailing list so that new users can see it (and existing users can find it easily). An HTML version of the document is always available at http://www.sqrug.org/sqr-users/sqr-users-hints.html. If you have comments or suggestions about this document, please contact me directly at the address listed in the title section. This document is Copyright (C) 1999-2004 by Ray Ontko & Co. It may be freely copied and distributed provided it is not modified in any way and it retains the original copyright notice. 2.3. Related Mailing Lists Here are some mailing lists that cover topics relating to SQR in some way. sqr-jobs : SQR Jobs This list may be used for posting SQR-related resumes, recruitments, job announcements, project announcments, help- wanted, work-wanted ads, etc. To join, follow the link above, or send any message to "sqr-jobs-subscribe@yahoogroups.com". peoplesoft-fans : PeopleSoft Fans Moderated list covering technical and functional aspects of PeopleSoft. To join, follow the link above, or send any message to "peoplesoft-fans-subscribe@yahoogroups.com". psusers : PeopleSoft Users For questions related to any aspect of PeopleSoft (including PeopleSoft-specific SQR issues). This list has merged with the Peoplesoft Fans mailing list and is no longer active, but the message achive can still be found at the link above. BrioSQRReport : Brio SQR Report List for discussion of SQR and SQR Developer (formerly called Brio.Report and Report Builder). To join, follow the link above, or send any message to "BrioSQRReport- subscribe@yahoogroups.com". rm-users : Report- Mart Users List for discussion of Brio Portal (previously called ReportMart). To join, follow the link above, or send a message containing the word "subscribe" in the body to "rm-users- request@sqrug.org". brioportalusersgroup : Brio Portal Users Group list List for discussion of Brio Portal. To join, follow the link above, or send any message to "brioportalusersgroup- subscribe@yahoogroups.com". brio-l : OpenITx Brio List List for technical and functional discussion of all Brio products (but most messages are currently about Brio Intelligence). To join, follow the link above. briousers : Brio.Enter- prise Users List for discussion of the Brio.Enterprise (now called Intelligence) product. To join, follow the link above, or send any message to "briousers-subscribe@yahoogroups.com". briolist : Brio List List for discussion of Brio Intelligence. To join, follow the link above, or send any message to "briolist- subscribe@yahoogroups.com". 3. Interacting with the list server The sqr-users mailing list is hosted using the Mailman list server package. All of the Mailman functions described below are accessed from the sqr-users List Info page, "http://www.sqrug.org/mailman/listinfo/sqr-users". 3.1. Subscribing to the list To subscribe to the mailing list, enter your e-mail address in the box at the top of the "Subscribing to sqr-users" section on the sqr-users List Info page, then choose a password to assign to your subscription and enter it in both "Password" boxes. This password is used to allow you to securely make changes to your subscription over the web. This password will be e-mailed back to you at varous times, so you should not use the same password as you are using elsewhere. Once you have filled in the password, click the "Subscribe" button. You should soon receive an e-mail message from the list server requesting confirmation of your subscription request. Once you have replied to this message and your subscription has been processed, you will receive a "welcome" message giving you more information on the list server, and as well as a reminder of the subscription password you chose. 3.2. Unsubscribing from the list To unsubscribe from the list, go to the sqr-users List Info page, enter your e-mail address in the "sqr-users Subscribers" section near the bottom of the page, and click the "Unsubscribe or edit options" button. You will then see the "member options" page; fill in your password at the top of the page and click "Log in". (If you have forgotton your password, see the ``Obtaining your Password'' section, below). This will take you to the "membership configuration" page. In the middle of that page, there will be an "Unsubscribing from sqr- users" section; simply turn on the "Yes, I really want to unsubscribe" checkbox and click the "Unsubscribe" button. You should get a page back saying that the removal was successful (as well as a confirmation email message). The removal will take effect immediately; there is no need to send in a confirmation e-mail message. If you don't know your password, you can choose to unsubscribe using e-mail confirmation. Instead of entering the password on the "member options" page, just click the "Unsubscribe" button found just below the "Log In" button. You will then see a page noting that a confirmation e-mail has been sent; once you follow the confirmation instructions in that e-mail your removal will be complete. 3.3. When your email address changes If your e-mail address changes -- for example, if your company changes names, or if your mail administrator changes the way your name is spelled out or abbreviated -- you will need to update your subscription to match your new address before you can post to the list (see the ``Posting'' section, below). To do this, simply log in to your "membership configuration" page (see the directions for logging in to this page in the ``Unsubscribing'' section, above). At the top of that page you'll see a "Changing your membership information" section. Fill out the text boxes and click the "Change My Address and Name" button. You will be sent a confirmation e-mail, and once you have responded to that e-mail your subscription will be updated and you can begin posting from your new address. 3.4. Digests You can request to get your messages in digest form (one large message containing all of the posts made each day). To do this, log in to your "membership configuration" page (see the directions on doing this in the ``Unsubscribing'' section, above). At the bottom of the page, you will see a section titled "Your sqr-users Subscription Options". Change the "Set Digest Mode" option (the second option in the list) to "On" and click the "Submit My Changes" button at the bottom of the page. You actually have a choice of two different digest formats, "MIME" or "Plain Text". The MIME format sends each individual list message as a separate MIME attachment to the digest; the plain text format consists of one large text message, with all of the individual messages run together. Which format you will want to use depends on your mail- reading software (and personal preference). If you are not sure which format will work best, you can just leave the default setting of "MIME" and see if the next morning's digest is easy to read in your mail reader -- you can change to the other format at any time using that same web page. If you use digests, you should not just "reply" to the digest mailing. Instead, be sure your message's subject header matches the subject in the original posting to which you are replying, and that you don't include a quoted copy of the entire digest in your post. To restore normal distribution, simply follow the above instructions choosing the "Off" setting for the Digest option. 3.5. Obtaining your password You will not be able to change your subscription options without your password. If you have forgotten your password, simply click the "Email My Password to Me" button on the "member options" page and your password will be emailed to you. You will also be e-mailed a copy of your password at the beginning of each month, as part of a "mailing list memberships reminder" message from the Mailman software. 3.6. Problems If the above instructions do not work, please contact the list manager at "sqr-users-manager@sqrug.org". (Do not send a message to the list itself -- no one there can help you with your problem!) Please include a description of what you were trying to do and what exactly happened when you made the attempt. 4. Posting to the sqr-users List In order to post to the mailing list, you must be subscribed to it (see directions above). More specifically, in order for Mailman to recognize that this message was sent by a subscriber, the return address on your message much exactly match the addresss you used to subscribe -- if you have more than one address you will need to be sure that you are sending from the correct one. (See the ``When you email address changes'' section, above, if your e-mail address has changed since you subscribed.) 4.1. General Guidelines For any message you send to the list, please: o make sure your mail software is not requesting a "Return Receipt". (If a "Return Receipt Requested" message is sent to the list, several dozen receipt messages will be sent out to the mailing list as other subscribers' mail systems repond....) o do not send messages in HTML or other special formats. (These are not usable by many subscribers, especially those who receive their messages in digest format.) The list server will delete these special attachments from your message and send you a warning notice. Also, if you are trying to send (for example) SQR source code files, make sure your mail-reader software is assigning proper MIME types to your attachments or they may not be distributed. o keep in mind that over 500 people will receive your message, and that it will appear in the list archives. Try to keep your messages on-topic and relatively short. Consider sending your message directly to particular people if it won't interest many of the list's subscribers. o ignore abusive and inappropriate messages that get sent to the list, rather than getting drawn into a debate. The very nature of these messages will cause most subscribers to automatically discredit them -- no "response" is necessary. To the contrary, any response will only "add fuel to the fire," prolonging the controversy and further interupting the normal conversation on the list. 4.2. Posting a Message Once you are subscribed, you can post to the list by sending a message to "sqr-users@sqrug.org". Be sure your subject heading describes your specific problem or question (i.e. don't just use "SQR Question"). In the body of your message, please include the following information: o SQR product name and version number (see notes below) o Operating system name and version number o Database name and version number o Application name (i.e. PeopleSoft) and a version number, if any Also, include a short code sample whenever possible. It's much easier for other people to understand what you are trying to do when they can see the actual code. (At the same time, be careful not to post confidential or proprietary code, since the posting will be placed in a public web archive.) Note that your question should relate to SQR or other Brio Report product in some way. Don't ask questions about PeopleSoft, for example, unless you are having SQR-related issues. (For PeopleSoft- specific questions, see other lists mentioned in the ``Related Mailing Lists'' section.) In 2001, PeopleSoft purchased from Brio the rights to the source code for SQR and began releasing its own line of SQR. PeopleSoft's SQR version numbering is different from Brio/Hyperion's, so it's very important to mention whether you are using Hyperion's "SQR" or "SQR for PeopleSoft". (This info is included automatically if you include the full SQR version-id string as described below.) To get the version-id string for your copy of SQR, you can run the following program: begin-program show $sqr-ver end-program This will produce a line that looks something like this: SQR/3.0.15/Intel/SCO Unix R3.2 V5.0/Oracle 7.2.2.3/Sep 25 1996 Include the full line of output in your message. Note that the oper- ating system and database version numbers listed here are the ones under which this copy of SQR was compiled, so you'll still need to include this information for your own environment. In a command-line environment (Unix, etc.), you can also get this version-id string by saying sqr -id 4.3. Replying to a Message Messages sent out on the list have a Reply-To header pointing to the list. This means that you should be able to simply use your mail reader's "reply" function to send a reply to the list. Generally, all answers to questions sent out on the list should be public replies, so that other subscribers can benefit. In those cases where a private reply is appropriate, be sure to over-ride the default Reply-To address. If your message is not actually a reply to the earlier message, please do not use the "reply" function. Instead, address a new e-mail message to the list as described in the previous section. (This is because the list archives will incorrectly show the new message in the original thread if you use "reply".) You should quote enough lines from the original message that later readers can understand your answer even if they missed the original question. At the same time, you should remove any unnecessary lines from the quote in order to make your message shorter and easier to understand. (Remember that some people read the mailing list in digest form, and the digests become much larger if unnecessary lines are quoted.) 5. Job Announcements Please do not post job announcements on the sqr-users list, but use the sqr-jobs list instead. (See ``Related Mailing Lists'' for more information on this list.) A large number of sqr-users subscribers do not want to receive job announcements (for various reasons) and such posts tend to cause a lot of disruption of the discussion on the list. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 01 11:54:46 2005 Date: Fri, 1 Apr 2005 08:54:07 -0800 From: marc pechaitis Subject: [sqr-users] printing two portrait pages on a landscape page? Hello all - Thanks again for the help with the column problem I inquired about yesterday. The report I am writing is for a SQR being run in PeopleSoft. PeopleSoft delivers a sqc called "setup02.sqc" that formats the report to print in Landscape orientation (and "setup01.sqc" prints in Portrait). The users want the report to print two (portrait) pages to a landscape orientation. Is anyone aware of a different sqc that might do this automatically? If not, does anyone have any suggestions about a way to do this (counting lines? -ugh)? We were thinking that this could be an issue better handled with the printer driver, but the report will be printing directly from PeopleSoft so it would be extra tricky to figure out how to make that work. So I figured I'd throw it out there to see if anyone has figured out a good way to do this. Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 01 12:20:23 2005 From: "Paul Hoyte" Subject: RE: [sqr-users] printing two portrait pages on a landscape page? Date: Fri, 1 Apr 2005 12:19:46 -0500 Marc: One way would be to use the printer driver and tell it to print 2 pages per sheet in landscape mode (like PowerPoint), or you can use the column feature of SQR and create 2 logical pages in landscape mode and then just print using the column commands. Paul Hoyte (248) 752-6970 Cell (586) 421-9640 Fax pa_hoyte@si-proservices.com (Email) www.sharidionne.com (Web Site) -----Original Message----- From: sqr-users-bounces+pi_hoyte=si-proservices.com@sqrug.org [mailto:sqr-users-bounces+pi_hoyte=si-proservices.com@sqrug.org] On Behalf Of marc pechaitis Sent: Friday, April 01, 2005 11:54 AM To: sqr-users@sqrug.org Subject: [sqr-users] printing two portrait pages on a landscape page? Hello all - Thanks again for the help with the column problem I inquired about yesterday. The report I am writing is for a SQR being run in PeopleSoft. PeopleSoft delivers a sqc called "setup02.sqc" that formats the report to print in Landscape orientation (and "setup01.sqc" prints in Portrait). The users want the report to print two (portrait) pages to a landscape orientation. Is anyone aware of a different sqc that might do this automatically? If not, does anyone have any suggestions about a way to do this (counting lines? -ugh)? We were thinking that this could be an issue better handled with the printer driver, but the report will be printing directly from PeopleSoft so it would be extra tricky to figure out how to make that work. So I figured I'd throw it out there to see if anyone has figured out a good way to do this. Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 01 15:15:45 2005 Subject: Re: [sqr-users] printing two portrait pages on a landscape page? Date: Fri, 1 Apr 2005 18:07:05 -0000 From: Hi Marc, some printers (Xerox, IBM transport underneath the physical versus logical page) will allow you to select that as a printer setup option in the driver (multiple logical pages on one physical page, seascape, landscape, shrink, etc); however, I have only done it using a postscript printer (not HP since it needs quarter inch of transport on left and right side). Some of the problems include whether you are using fixed versus proportional font and whether you are using html and/or a line printer and of course images. The SQR user group library has some code that might provide some assistance. How the includes there mesh with Oracle/PeopleSoft sqc's I can't comment on without experimentation. John Willson jwillson@dssltd.com marc pechaitis said: > Hello all - > Thanks again for the help with the column problem I inquired about yesterday. > > The report I am writing is for a SQR being run in PeopleSoft. > PeopleSoft delivers a sqc called "setup02.sqc" that formats the report > to print in Landscape orientation (and "setup01.sqc" prints in > Portrait). > > The users want the report to print two (portrait) pages to a landscape > orientation. Is anyone aware of a different sqc that might do this > automatically? If not, does anyone have any suggestions about a way > to do this (counting lines? -ugh)? > > We were thinking that this could be an issue better handled with the > printer driver, but the report will be printing directly from > PeopleSoft so it would be extra tricky to figure out how to make that > work. So I figured I'd throw it out there to see if anyone has > figured out a good way to do this. > > > Thanks! > Marc > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > -- _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 10:40:26 2005 From: Olga.Gal@bbh.com Date: Mon, 4 Apr 2005 11:38:53 -0400 Subject: [sqr-users] Dynamic SQL vs. Fixed SQL execution We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 10:50:51 2005 Subject: Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution From: Wjatscheslaw KRAVTCHENKO Date: Mon, 4 Apr 2005 17:50:35 +0200 Dear Olga, is the SQR forming the SQL slow or is the response from the database slow? How slow is it? Wha amount of data are we dealing with? We had a similar scenario on Sybase 12.5 transactional data. Do you have any samples of the SQL stmts ? How is the Warehouse structured? Anticipating your reply. ______________________________________ Wjatscheslaw Kravtchenko (Mr.) ProFi System Manager Assistant ProFi Technical Team Information Technology Service Division for Management United Nations Office on Drugs and Crime Tel: (+43-1) 26060-4153 Websites: www.unov.org, www.unodc.org ______________________________________ Impossible is not a fact, only an opinion Olga.Gal@bbh.com Sent by: sqr-users-bounces To +wjatscheslaw.kra sqr-users@sqrug.org vtchenko=unvienna cc .org@sqrug.org Subject [sqr-users] Dynamic SQL vs. Fixed Monday, 4 April SQL execution 2005 17:38 Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 10:59:30 2005 From: Bob Stone Subject: RE: [sqr-users] Dynamic SQL vs. Fixed SQL execution Date: Mon, 4 Apr 2005 10:58:24 -0500 if you're creating the where clause dynamically, then yes, it will re-parse the select statement many times, adding a lot of unnecessary overhead. Also, when not using bind variables the SQL will sometime not use the index that was made for that specfic SQL. I forget the exact reasons for this, but we recently went through a similar exercise with one of our DBAs. We had a quick process/report turn slow all of a sudden, because we changed something and it stopped using a bind variable which made it stop using the index. (also of concern was that reparsing of the same repetitive SQL over and over). If a procedure executes a fixed SQL, I don't think it reparses it everytime. (I'm not 100% on this, but quite sure). I think rewriting it might solve your time issue. (sorry if that's not the answer you wanted to hear). We're using an older verison of SQR and we're on Oracle 8i, so I couldn't say if the problem we had is something fixed in later versions of either...but because of the type of problem, I would assume it's still the same. Another way to speed up the SQR running time is tuning the SQLs...making sure they're using an index every time. The actual processing of non-SQL parts of SQRs is ususally negligible compared to IO/DB time. You might discuss this with your DBA, run a trace to find which statements in the SQR are the slowest. Perhaps there's one statement taking 60% of the time, and could be tuned down to a matter of seconds? We've run into that with our reports/processes. I dont know where you are on SQR tuning these reports, so perhaps switching to non-dynamic SQL is the biggest time saver. But to answer your original question, yes, I think if you could rewrite them non-dynamically that would save you parsing time (sometimes huge overhead, depending on number of times SQL is run). -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Olga.Gal@bbh.com Sent: Monday, April 04, 2005 10:39 AM To: sqr-users@sqrug.org Subject: [sqr-users] Dynamic SQL vs. Fixed SQL execution We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 11:24:40 2005 Subject: Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution From: Olga.Gal@bbh.com Date: Mon, 4 Apr 2005 12:22:52 -0400 Dear Wjatscheslaw, To produce the report we access huge wide tables (millions of rows) that are joined by indexed columns. The queries are carefully tuned and executed fairly quickly outside the SQR. The processing starts with an outer (driving) query, which supposed to be the slowest one. It would return back thousands of rows, and then 90 percent of the selected rows are processed further: for each processed rows the SQR then selects additional information from 6 other queries that are dynamically constructed (dynamic SQL). These queries access the data by Primary Key, and are very fast when executed outside SQR. It takes over an hour to generate a report of about 650 such entities. By monitoring the progression of the report it looks like the driving query (the slowest one) is returning the list of entities fairly quickly, but it still takes too long to finish the report, which brought me to think that the problem is not really in the data access. Wjatscheslaw KRAVTCHENKO Sent by: sqr-users-bounces+olga.gal=bbh.com@sqrug.org To "This list is for discussion about the SQR database reporting language from Hyperion Solutions." 04/04/2005 11:50 AM cc Subject Please respond to Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Dear Olga, is the SQR forming the SQL slow or is the response from the database slow? How slow is it? Wha amount of data are we dealing with? We had a similar scenario on Sybase 12.5 transactional data. Do you have any samples of the SQL stmts ? How is the Warehouse structured? Anticipating your reply. ______________________________________ Wjatscheslaw Kravtchenko (Mr.) ProFi System Manager Assistant ProFi Technical Team Information Technology Service Division for Management United Nations Office on Drugs and Crime Tel: (+43-1) 26060-4153 Websites: www.unov.org, www.unodc.org ______________________________________ Impossible is not a fact, only an opinion Olga.Gal@bbh.com Sent by: sqr-users-bounces To +wjatscheslaw.kra sqr-users@sqrug.org vtchenko=unvienna cc .org@sqrug.org Subject [sqr-users] Dynamic SQL vs. Fixed Monday, 4 April SQL execution 2005 17:38 Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 11:44:47 2005 Date: Mon, 04 Apr 2005 12:43:20 -0400 From: "George Jansen" Subject: Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution Before you tune ANYTHING you should know where your time is going. As a fir= st step you might try something as simple as adding a procedure that looks = at v$mystat and seeing what the waits are. >>> Olga.Gal@bbh.com 04/04/05 11:38 AM >>> We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, = which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically= , based on user's selection, and execute the same Select statement many tim= es within the same job. This makes me think that the slow performance is po= ssibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixe= d Select statements with bind variables ONLY in the Where clause, I would l= ike to get assured that this approach will in fact eliminate unnecessary pa= rsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it d= o it only for a newly executed SQL. In other words, if my program will repe= atedly call a routine that executes a fixed SQL statement, will this statem= ent get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org=20 http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 12:10:21 2005 From: "the dragon" Subject: RE: [sqr-users] Dynamic SQL vs. Fixed SQL execution Date: Mon, 04 Apr 2005 12:01:22 -0500 You can see how many times the sql compiles, as well as how many times it executes, and the number of rows returned by using the -s parameter when you run the program. peace, clark 'the dragon' willis PSA: Salary <> Slavery. If you earn a salary, your employer is renting your services for 40 hours a week, not purchasing your soul. Your time is the only real finite asset that you have, and once used it can never be recovered, so don't waste it by giving it away. I work to live; I don't live to work. "Time is the coin of your life. It is the only coin you have, and only you can determine how it will be spent. Be careful lest you let other people spend it for you." Carl Sandburg (1878 - 1967) ----Original Message Follows---- We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 12:58:24 2005 From: yamuna_pandiyan@freddiemac.com Date: Mon, 4 Apr 2005 13:57:40 -0400 Subject: [sqr-users] Call SYSTEM command in SQR The following command works fine or the directory from where the SQR program runs - '/shared/main/prog/sqr'. This command does not look for the file in a different directory, i.e the data file resides in the data directory - ' /shared/main/files/data/'. This is true if the command is used with or without the predefined prefix variable. Example, I copied the data file from the above data directory to the SQR directory and ran the program.The latest SAMPLE.DAT file name was written into the filename defined in the '$file_list' variable. I did the cd command, $SqrDirectory = '/shared/main/prog/sqr' $DataDirectory = '/shared/main/files/data/' $CMD = 'cd' || $DataDirectory $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || $file_list call system using $syscmd #unix_status I get the error - SAMPLE.DAT: No such file or directory But the above command works fine if I copy the SAMPLE.DAT file into the SQR directory and use the following code, $cmd = 'ls -lt SAMPLE.DAT >' || ' ' || $file_list call system using $syscmd #unix_status Could you help me how to use the 'cd' command with 'ls' command or how to make the program to look for the data file in the data directory...? Thanks, Yamuna "Dattatraya Shetty" "This list is for discussion about the SQR database reporting language Sent by : from Hyperion Solutions." sqr-users-bounces+yamuna_pan diyan=freddiemac.com@sqrug.o cc rg Subject Re: [sqr-users] Call SYSTEM 03/31/2005 01:25 command in SQR PM Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." This fix is simple change the command to below let $syscmd = 'ls -lts SAMPLE.DAT >' || $file_list call system using $syscmd #unix_status if #unix_status != 0 stop quiet end-if No need to Add the fileprefix to ls command. Its a Unix command and if you add fileprefix to it the OS will try and execute the ls command from the path in fileprefix which is wrong because the ls command is not stored there. its some where in /usr/bin: if you need to give the path then log into unix and issue the following command $> whence ls see the path displayed and use that. HTH Datta. --- yamuna_pandiyan@freddiemac.com wrote: > > Hi Datta, > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > The > data file is created in the ' /shared/main/files/data/' directory. > The There > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > with all > other programs. > > But I am not able to debug, since I have limited knowledge on the > Call > System commands. When the below program is executed, the > Latestfile.dat is > created in the directory ' /shared/main/files/data/'. > > The error that is generated when executing the program is 'sh: > /shared/main/files/data/ls : not found' if I use the below command. > if I remove the {FILEPREFIX} from the command line, the following > error is > generated - '/shared/main/files/data/ : cannot execute' > > Thanks, > Yamuna > 918-5127 > > > > > "Dattatraya > > Shetty" > > To > oo.com> "This list is for discussion > about > the SQR database reporting > language > Sent by : from Hyperion Solutions." > > sqr-users-bounces+yamuna_pan > > diyan=freddiemac.com@sqrug.o > cc > rg > > > Subject > Re: [sqr-users] Call SYSTEM > > 03/30/2005 04:14 command in SQR > > PM > > > > > > Please respond to > > "This list is > > for discussion > > about the SQR > > database > > reporting > > language from > > Hyperion > > Solutions." > > > .org> > > > > > > > > > > Hi Yamuna, > The Second part of the Problem is that FILEPREFIX may be an > environment > variable not defined? > > In the fist part the $ is missing for an environment variable. > > It would help if you let us know what is the excat command you are > typing > in at the command > prompt. > > e.g > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > is this what you are typing ? > > The fact that you are getting a file called Latestfile.dat tells me > that > the FILEPREFIX is not defined or you are not keying it correctly what > is it > ? > > HTH > Datta. > > > > yamuna_pandiyan@freddiemac.com wrote: > I am using a program which needs to compare the current data with the > previous data file. the data files are created with date and time > stamp. > This program runs once a week, and has to compare the previous weeks > data > file to monitor the data changes. > > I am using the following command on the Unix box to sort the most > recent > file > > let $file_list = '{FILEPREFIX}Latestfile.dat' > > let $syscmd = '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status != 0 > stop quiet > end-if > > The Latestfile.dat file is created in the data directory mentioned > under > {FILEPREFIX}. But the file is empty. I would like to send the result > of the > command > ls -lts SAMPLE.DAT* to the above file. > when I execute the above program in the unix server , I ge the > following > error - {FILEPREFIX} : cannot execute, but a blank file in the name > of > Latestfile.dat is created. > > any help in greatly appreciated. > > Thanks, > Yamuna > 918-5127 > > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > > --------------------------------- > Do you Yahoo!? > Yahoo! Sports - Sign up for Fantasy Baseball. > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________ Do you Yahoo!? Yahoo! Personals - Better first dates. More second dates. http://personals.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 13:07:28 2005 Date: Mon, 04 Apr 2005 14:06:19 -0400 From: "Prasanna Menta" Subject: Re: [sqr-users] Call SYSTEM command in SQR You have to know the structure of your unix file directory - Also you need a space between cd and $datadirectory $CMD = 'cd' || ' '|| $DataDirectory yamuna_pandiyan@freddiemac.com wrote: > > The following command works fine or the directory from where the SQR > program runs - '/shared/main/prog/sqr'. This command does not look for the > file in a different directory, i.e the data file resides in the data > directory - ' /shared/main/files/data/'. This is true if the command is > used with or without the predefined prefix variable. > > Example, I copied the data file from the above data directory to the SQR > directory and ran the program.The latest SAMPLE.DAT file name was written > into the filename defined in the '$file_list' variable. > > I did the cd command, $SqrDirectory = '/shared/main/prog/sqr' > $DataDirectory = '/shared/main/files/data/' > > $CMD = 'cd' || $DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > > I get the error - SAMPLE.DAT: No such file or directory > > But the above command works fine if I copy the SAMPLE.DAT file into the SQR > directory and use the following code, > > $cmd = 'ls -lt SAMPLE.DAT >' || ' ' || $file_list > call system using $syscmd #unix_status > > Could you help me how to use the 'cd' command with 'ls' command or how to > make the program to look for the data file in the data directory...? > > Thanks, > Yamuna > > > "Dattatraya > Shetty" > oo.com> "This list is for discussion about > the SQR database reporting language > Sent by : from Hyperion Solutions." > sqr-users-bounces+yamuna_pan > diyan=freddiemac.com@sqrug.o cc > rg > Subject > Re: [sqr-users] Call SYSTEM > 03/31/2005 01:25 command in SQR > PM > > > Please respond to > "This list is > for discussion > about the SQR > database > reporting > language from > Hyperion > Solutions." > .org> > > > > This fix is simple change the command to below > let $syscmd = 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status != 0 > stop quiet > end-if > > No need to Add the fileprefix to ls command. Its a Unix command and if > you add fileprefix to it the OS will try and execute the ls command > from the path in fileprefix which is wrong because the ls command is > not stored there. its some where in /usr/bin: > if you need to give the path then log into unix and issue the following > command > > $> whence ls > see the path displayed and use that. > > HTH > Datta. > > --- yamuna_pandiyan@freddiemac.com wrote: > > > > > Hi Datta, > > > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > > The > > data file is created in the ' /shared/main/files/data/' directory. > > The > There > > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > > with all > > other programs. > > > > But I am not able to debug, since I have limited knowledge on the > > Call > > System commands. When the below program is executed, the > > Latestfile.dat is > > created in the directory ' /shared/main/files/data/'. > > > > The error that is generated when executing the program is 'sh: > > /shared/main/files/data/ls : not found' if I use the below command. > > if I remove the {FILEPREFIX} from the command line, the following > > error is > > generated - '/shared/main/files/data/ : cannot execute' > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > > > "Dattatraya > > > > Shetty" > > > > > To > > oo.com> "This list is for discussion > > about > > the SQR database reporting > > language > > Sent by : from Hyperion Solutions." > > > > sqr-users-bounces+yamuna_pan > > > > diyan=freddiemac.com@sqrug.o > > cc > > rg > > > > > > Subject > > Re: [sqr-users] Call SYSTEM > > > > 03/30/2005 04:14 command in SQR > > > > PM > > > > > > > > > > > > Please respond to > > > > "This list is > > > > for discussion > > > > about the SQR > > > > database > > > > reporting > > > > language from > > > > Hyperion > > > > Solutions." > > > > > > > .org> > > > > > > > > > > > > > > > > > > > > Hi Yamuna, > > The Second part of the Problem is that FILEPREFIX may be an > > environment > > variable not defined? > > > > In the fist part the $ is missing for an environment variable. > > > > It would help if you let us know what is the excat command you are > > typing > > in at the command > > prompt. > > > > e.g > > > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > > is this what you are typing ? > > > > The fact that you are getting a file called Latestfile.dat tells me > > that > > the FILEPREFIX is not defined or you are not keying it correctly what > > is it > > ? > > > > HTH > > Datta. > > > > > > > > yamuna_pandiyan@freddiemac.com wrote: > > I am using a program which needs to compare the current data with the > > previous data file. the data files are created with date and time > > stamp. > > This program runs once a week, and has to compare the previous weeks > > data > > file to monitor the data changes. > > > > I am using the following command on the Unix box to sort the most > > recent > > file > > > > let $file_list = '{FILEPREFIX}Latestfile.dat' > > > > let $syscmd = '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > > call system using $syscmd #unix_status > > if #unix_status != 0 > > stop quiet > > end-if > > > > The Latestfile.dat file is created in the data directory mentioned > > under > > {FILEPREFIX}. But the file is empty. I would like to send the result > > of the > > command > > ls -lts SAMPLE.DAT* to the above file. > > when I execute the above program in the unix server , I ge the > > following > > error - {FILEPREFIX} : cannot execute, but a blank file in the name > > of > > Latestfile.dat is created. > > > > any help in greatly appreciated. > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Sports - Sign up for Fantasy Baseball. > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________ > Do you Yahoo!? > Yahoo! Personals - Better first dates. More second dates. > http://personals.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 13:13:08 2005 Subject: Re: [sqr-users] Call SYSTEM command in SQR From: yamuna_pandiyan@freddiemac.com Date: Mon, 4 Apr 2005 14:12:32 -0400 Yes there is a space in the cmd line , that was a typo in the below email, it should be - $CMD = 'cd' || ' ' || $DataDirectory Thanks, Yamuna 918-5127 "Prasanna Menta" To Sent by : "This list is for discussion about sqr-users-bounces+yamuna_pan the SQR database reporting language diyan=freddiemac.com@sqrug.o from Hyperion Solutions." rg cc 04/04/2005 02:06 Subject PM Re: [sqr-users] Call SYSTEM command in SQR Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." You have to know the structure of your unix file directory - Also you need a space between cd and $datadirectory $CMD = 'cd' || ' '|| $DataDirectory yamuna_pandiyan@freddiemac.com wrote: > > The following command works fine or the directory from where the SQR > program runs - '/shared/main/prog/sqr'. This command does not look for the > file in a different directory, i.e the data file resides in the data > directory - ' /shared/main/files/data/'. This is true if the command is > used with or without the predefined prefix variable. > > Example, I copied the data file from the above data directory to the SQR > directory and ran the program.The latest SAMPLE.DAT file name was written > into the filename defined in the '$file_list' variable. > > I did the cd command, $SqrDirectory = '/shared/main/prog/sqr' > $DataDirectory = '/shared/main/files/data/' > > $CMD = 'cd' ||$DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > > I get the error - SAMPLE.DAT: No such file or directory > > But the above command works fine if I copy the SAMPLE.DAT file into the SQR > directory and use the following code, > > $cmd = 'ls -lt SAMPLE.DAT >' || ' ' || $file_list > call system using $syscmd #unix_status > > Could you help me how to use the 'cd' command with 'ls' command or how to > make the program to look for the data file in the data directory...? > > Thanks, > Yamuna > > > "Dattatraya > Shetty" > oo.com> "This list is for discussion about > the SQR database reporting language > Sent by : from Hyperion Solutions." > sqr-users-bounces+yamuna_pan > diyan=freddiemac.com@sqrug.o cc > rg > Subject > Re: [sqr-users] Call SYSTEM > 03/31/2005 01:25 command in SQR > PM > > > Please respond to > "This list is > for discussion > about the SQR > database > reporting > language from > Hyperion > Solutions." > .org> > > > > This fix is simple change the command to below > let $syscmd = 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status != 0 > stop quiet > end-if > > No need to Add the fileprefix to ls command. Its a Unix command and if > you add fileprefix to it the OS will try and execute the ls command > from the path in fileprefix which is wrong because the ls command is > not stored there. its some where in /usr/bin: > if you need to give the path then log into unix and issue the following > command > > $> whence ls > see the path displayed and use that. > > HTH > Datta. > > --- yamuna_pandiyan@freddiemac.com wrote: > > > > > Hi Datta, > > > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > > The > > data file is created in the ' /shared/main/files/data/' directory. > > The > There > > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > > with all > > other programs. > > > > But I am not able to debug, since I have limited knowledge on the > > Call > > System commands. When the below program is executed, the > > Latestfile.dat is > > created in the directory ' /shared/main/files/data/'. > > > > The error that is generated when executing the program is 'sh: > > /shared/main/files/data/ls : not found' if I use the below command. > > if I remove the {FILEPREFIX} from the command line, the following > > error is > > generated - '/shared/main/files/data/ : cannot execute' > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > > > "Dattatraya > > > > Shetty" > > > > > To > > oo.com> "This list is for discussion > > about > > the SQR database reporting > > language > > Sent by : from Hyperion Solutions." > > > > sqr-users-bounces+yamuna_pan > > > > diyan=freddiemac.com@sqrug.o > > cc > > rg > > > > > > Subject > > Re: [sqr-users] Call SYSTEM > > > > 03/30/2005 04:14 command in SQR > > > > PM > > > > > > > > > > > > Please respond to > > > > "This list is > > > > for discussion > > > > about the SQR > > > > database > > > > reporting > > > > language from > > > > Hyperion > > > > Solutions." > > > > > > > .org> > > > > > > > > > > > > > > > > > > > > Hi Yamuna, > > The Second part of the Problem is that FILEPREFIX may be an > > environment > > variable not defined? > > > > In the fist part the $ is missing for an environment variable. > > > > It would help if you let us know what is the excat command you are > > typing > > in at the command > > prompt. > > > > e.g > > > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > > is this what you are typing ? > > > > The fact that you are getting a file called Latestfile.dat tells me > > that > > the FILEPREFIX is not defined or you are not keying it correctly what > > is it > > ? > > > > HTH > > Datta. > > > > > > > > yamuna_pandiyan@freddiemac.com wrote: > > I am using a program which needs to compare the current data with the > > previous data file. the data files are created with date and time > > stamp. > > This program runs once a week, and has to compare the previous weeks > > data > > file to monitor the data changes. > > > > I am using the following command on the Unix box to sort the most > > recent > > file > > > > let $file_list = '{FILEPREFIX}Latestfile.dat' > > > > let $syscmd = '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > > call system using $syscmd #unix_status > > if #unix_status != 0 > > stop quiet > > end-if > > > > The Latestfile.dat file is created in the data directory mentioned > > under > > {FILEPREFIX}. But the file is empty. I would like to send the result > > of the > > command > > ls -lts SAMPLE.DAT* to the above file. > > when I execute the above program in the unix server , I ge the > > following > > error - {FILEPREFIX} : cannot execute, but a blank file in the name > > of > > Latestfile.dat is created. > > > > any help in greatly appreciated. > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Sports - Sign up for Fantasy Baseball. > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________ > Do you Yahoo!? > Yahoo! Personals - Better first dates. More second dates. > http://personals.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 13:56:05 2005 Subject: RE: [sqr-users] Call SYSTEM command in SQR Date: Mon, 4 Apr 2005 14:54:51 -0400 From: "Beller, Jay" Do you have WRITE access to $DataDirectory? Try a command like "touch anyfile" in $DataDirectory and see if you get per= mission error. -----Original Message----- From: sqr-users-bounces+jbeller=3Dlbisoftware.com@sqrug.org [mailto:sqr-users-bounces+jbeller=3Dlbisoftware.com@sqrug.org]On Behalf Of yamuna_pandiyan@freddiemac.com Sent: Monday, April 04, 2005 2:13 PM To: sqr-users@sqrug.org Subject: Re: [sqr-users] Call SYSTEM command in SQR Yes there is a space in the cmd line , that was a typo in the below email, it should be - $CMD =3D 'cd' || ' ' || $DataDirectory Thanks, Yamuna 918-5127 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 "Prasanna Menta"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 To= =20 Sent by : "This list is for discussion about= =20=20 sqr-users-bounces+yamuna_pan the SQR database reporting language= =20 diyan=3Dfreddiemac.com@sqrug.o from Hyperion Solutions."=20=20=20= =20=20=20=20=20=20=20=20 rg =20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20 cc= =20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 04/04/2005 02:06 Subject= =20 PM Re: [sqr-users] Call SYSTEM=20=20=20= =20=20=20=20=20=20 command in SQR=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Please respond to=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 "This list is=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 for discussion=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 about the SQR=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 database=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 reporting=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 language from=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 Hyperion=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 Solutions."=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 You have to know the structure of your unix file directory - Also you need a space between cd and $datadirectory $CMD =3D 'cd' || ' '|| $DataDirectory yamuna_pandiyan@freddiemac.com wrote: > > The following command works fine or the directory from where the SQR > program runs - '/shared/main/prog/sqr'. This command does not look for the > file in a different directory, i.e the data file resides in the data > directory - ' /shared/main/files/data/'. This is true if the command is > used with or without the predefined prefix variable. > > Example, I copied the data file from the above data directory to the SQR > directory and ran the program.The latest SAMPLE.DAT file name was written > into the filename defined in the '$file_list' variable. > > I did the cd command, $SqrDirectory =3D '/shared/main/prog/sqr' > $DataDirectory =3D '/shared/main/files/data/' > > $CMD =3D 'cd' ||$DataDirectory > $cmd =3D 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > > I get the error - SAMPLE.DAT: No such file or directory > > But the above command works fine if I copy the SAMPLE.DAT file into the SQR > directory and use the following code, > > $cmd =3D 'ls -lt SAMPLE.DAT >' || ' ' || $file_list > call system using $syscmd #unix_status > > Could you help me how to use the 'cd' command with 'ls' command or how to > make the program to look for the data file in the data directory...? > > Thanks, > Yamuna > > > "Dattatraya > Shetty" > oo.com> "This list is for discussion about > the SQR database reporting language > Sent by : from Hyperion Solutions." > sqr-users-bounces+yamuna_pan > diyan=3Dfreddiemac.com@sqrug.o cc > rg > Subject > Re: [sqr-users] Call SYSTEM > 03/31/2005 01:25 command in SQR > PM > > > Please respond to > "This list is > for discussion > about the SQR > database > reporting > language from > Hyperion > Solutions." > .org> > > > > This fix is simple change the command to below > let $syscmd =3D 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status !=3D 0 > stop quiet > end-if > > No need to Add the fileprefix to ls command. Its a Unix command and if > you add fileprefix to it the OS will try and execute the ls command > from the path in fileprefix which is wrong because the ls command is > not stored there. its some where in /usr/bin: > if you need to give the path then log into unix and issue the following > command > > $> whence ls > see the path displayed and use that. > > HTH > Datta. > > --- yamuna_pandiyan@freddiemac.com wrote: > > > > > Hi Datta, > > > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > > The > > data file is created in the ' /shared/main/files/data/' directory. > > The > There > > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > > with all > > other programs. > > > > But I am not able to debug, since I have limited knowledge on the > > Call > > System commands. When the below program is executed, the > > Latestfile.dat is > > created in the directory ' /shared/main/files/data/'. > > > > The error that is generated when executing the program is 'sh: > > /shared/main/files/data/ls : not found' if I use the below command. > > if I remove the {FILEPREFIX} from the command line, the following > > error is > > generated - '/shared/main/files/data/ : cannot execute' > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > > > "Dattatraya > > > > Shetty" > > > > > To > > oo.com> "This list is for discussion > > about > > the SQR database reporting > > language > > Sent by : from Hyperion Solutions." > > > > sqr-users-bounces+yamuna_pan > > > > diyan=3Dfreddiemac.com@sqrug.o > > cc > > rg > > > > > > Subject > > Re: [sqr-users] Call SYSTEM > > > > 03/30/2005 04:14 command in SQR > > > > PM > > > > > > > > > > > > Please respond to > > > > "This list is > > > > for discussion > > > > about the SQR > > > > database > > > > reporting > > > > language from > > > > Hyperion > > > > Solutions." > > > > > > > .org> > > > > > > > > > > > > > > > > > > > > Hi Yamuna, > > The Second part of the Problem is that FILEPREFIX may be an > > environment > > variable not defined? > > > > In the fist part the $ is missing for an environment variable. > > > > It would help if you let us know what is the excat command you are > > typing > > in at the command > > prompt. > > > > e.g > > > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > > is this what you are typing ? > > > > The fact that you are getting a file called Latestfile.dat tells me > > that > > the FILEPREFIX is not defined or you are not keying it correctly what > > is it > > ? > > > > HTH > > Datta. > > > > > > > > yamuna_pandiyan@freddiemac.com wrote: > > I am using a program which needs to compare the current data with the > > previous data file. the data files are created with date and time > > stamp. > > This program runs once a week, and has to compare the previous weeks > > data > > file to monitor the data changes. > > > > I am using the following command on the Unix box to sort the most > > recent > > file > > > > let $file_list =3D '{FILEPREFIX}Latestfile.dat' > > > > let $syscmd =3D '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > > call system using $syscmd #unix_status > > if #unix_status !=3D 0 > > stop quiet > > end-if > > > > The Latestfile.dat file is created in the data directory mentioned > > under > > {FILEPREFIX}. But the file is empty. I would like to send the result > > of the > > command > > ls -lts SAMPLE.DAT* to the above file. > > when I execute the above program in the unix server , I ge the > > following > > error - {FILEPREFIX} : cannot execute, but a blank file in the name > > of > > Latestfile.dat is created. > > > > any help in greatly appreciated. > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Sports - Sign up for Fantasy Baseball. > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________ > Do you Yahoo!? > Yahoo! Personals - Better first dates. More second dates. > http://personals.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 14:09:11 2005 Date: Mon, 04 Apr 2005 15:07:46 -0400 From: "Jamie Harris" Subject: Re: [sqr-users] Call SYSTEM command in SQR Hello, > $CMD = 'cd' ||$DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > It looks to me like the above would not even try to execute the 'cd' command, since there is no 'call system' between the first and second lines (which each assign $CMD to something). SQR variable names are not case-sensitive. I also see that in the call system command, it's using $syscmd - I don't know where that gets set, but it's not going to contain the cd or ls commands above. If 'cd' won't work in the program, you could try this: let $cmd = 'ls -lt ' $DataDirectory || '/SAMPLE.DAT >' || $DataDirectory || > $file_list call system using $cmd #unix_status There's no need to actually move to $DataDirectory if all you need is a listing of the sample.dat files within. Hope this helps! ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> yamuna_pandiyan@freddiemac.com 4/4/2005 2:12:32 PM >>> Yes there is a space in the cmd line , that was a typo in the below email, it should be - $CMD = 'cd' || ' ' || $DataDirectory Thanks, Yamuna 918-5127 "Prasanna Menta" To Sent by : "This list is for discussion about sqr-users-bounces+yamuna_pan the SQR database reporting language diyan=freddiemac.com@sqrug.o from Hyperion Solutions." rg cc 04/04/2005 02:06 Subject PM Re: [sqr-users] Call SYSTEM command in SQR Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." You have to know the structure of your unix file directory - Also you need a space between cd and $datadirectory $CMD = 'cd' || ' '|| $DataDirectory yamuna_pandiyan@freddiemac.com wrote: > > The following command works fine or the directory from where the SQR > program runs - '/shared/main/prog/sqr'. This command does not look for the > file in a different directory, i.e the data file resides in the data > directory - ' /shared/main/files/data/'. This is true if the command is > used with or without the predefined prefix variable. > > Example, I copied the data file from the above data directory to the SQR > directory and ran the program.The latest SAMPLE.DAT file name was written > into the filename defined in the '$file_list' variable. > > I did the cd command, $SqrDirectory = '/shared/main/prog/sqr' > $DataDirectory = '/shared/main/files/data/' > > $CMD = 'cd' ||$DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > > I get the error - SAMPLE.DAT: No such file or directory > > But the above command works fine if I copy the SAMPLE.DAT file into the SQR > directory and use the following code, > > $cmd = 'ls -lt SAMPLE.DAT >' || ' ' || $file_list > call system using $syscmd #unix_status > > Could you help me how to use the 'cd' command with 'ls' command or how to > make the program to look for the data file in the data directory...? > > Thanks, > Yamuna > > > "Dattatraya > Shetty" > oo.com> "This list is for discussion about > the SQR database reporting language > Sent by : from Hyperion Solutions." > sqr-users-bounces+yamuna_pan > diyan=freddiemac.com@sqrug.o cc > rg > Subject > Re: [sqr-users] Call SYSTEM > 03/31/2005 01:25 command in SQR > PM > > > Please respond to > "This list is > for discussion > about the SQR > database > reporting > language from > Hyperion > Solutions." > .org> > > > > This fix is simple change the command to below > let $syscmd = 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status != 0 > stop quiet > end-if > > No need to Add the fileprefix to ls command. Its a Unix command and if > you add fileprefix to it the OS will try and execute the ls command > from the path in fileprefix which is wrong because the ls command is > not stored there. its some where in /usr/bin: > if you need to give the path then log into unix and issue the following > command > > $> whence ls > see the path displayed and use that. > > HTH > Datta. > > --- yamuna_pandiyan@freddiemac.com wrote: > > > > > Hi Datta, > > > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > > The > > data file is created in the ' /shared/main/files/data/' directory. > > The > There > > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > > with all > > other programs. > > > > But I am not able to debug, since I have limited knowledge on the > > Call > > System commands. When the below program is executed, the > > Latestfile.dat is > > created in the directory ' /shared/main/files/data/'. > > > > The error that is generated when executing the program is 'sh: > > /shared/main/files/data/ls : not found' if I use the below command. > > if I remove the {FILEPREFIX} from the command line, the following > > error is > > generated - '/shared/main/files/data/ : cannot execute' > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > > > "Dattatraya > > > > Shetty" > > > > > To > > oo.com> "This list is for discussion > > about > > the SQR database reporting > > language > > Sent by : from Hyperion Solutions." > > > > sqr-users-bounces+yamuna_pan > > > > diyan=freddiemac.com@sqrug.o > > cc > > rg > > > > > > Subject > > Re: [sqr-users] Call SYSTEM > > > > 03/30/2005 04:14 command in SQR > > > > PM > > > > > > > > > > > > Please respond to > > > > "This list is > > > > for discussion > > > > about the SQR > > > > database > > > > reporting > > > > language from > > > > Hyperion > > > > Solutions." > > > > > > > .org> > > > > > > > > > > > > > > > > > > > > Hi Yamuna, > > The Second part of the Problem is that FILEPREFIX may be an > > environment > > variable not defined? > > > > In the fist part the $ is missing for an environment variable. > > > > It would help if you let us know what is the excat command you are > > typing > > in at the command > > prompt. > > > > e.g > > > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > > is this what you are typing ? > > > > The fact that you are getting a file called Latestfile.dat tells me > > that > > the FILEPREFIX is not defined or you are not keying it correctly what > > is it > > ? > > > > HTH > > Datta. > > > > > > > > yamuna_pandiyan@freddiemac.com wrote: > > I am using a program which needs to compare the current data with the > > previous data file. the data files are created with date and time > > stamp. > > This program runs once a week, and has to compare the previous weeks > > data > > file to monitor the data changes. > > > > I am using the following command on the Unix box to sort the most > > recent > > file > > > > let $file_list = '{FILEPREFIX}Latestfile.dat' > > > > let $syscmd = '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > > call system using $syscmd #unix_status > > if #unix_status != 0 > > stop quiet > > end-if > > > > The Latestfile.dat file is created in the data directory mentioned > > under > > {FILEPREFIX}. But the file is empty. I would like to send the result > > of the > > command > > ls -lts SAMPLE.DAT* to the above file. > > when I execute the above program in the unix server , I ge the > > following > > error - {FILEPREFIX} : cannot execute, but a blank file in the name > > of > > Latestfile.dat is created. > > > > any help in greatly appreciated. > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Sports - Sign up for Fantasy Baseball. > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________ > Do you Yahoo!? > Yahoo! Personals - Better first dates. More second dates. > http://personals.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 14:16:44 2005 Subject: Re: [sqr-users] Call SYSTEM command in SQR From: yamuna_pandiyan@freddiemac.com Date: Mon, 4 Apr 2005 15:16:01 -0400 Thanks Jamie, It works. Yamuna 918-5127 "Jamie Harris" To sqr-users@sqrug.org Sent by : cc sqr-users-bounces+yamuna_pan diyan=freddiemac.com@sqrug.o Subject rg Re: [sqr-users] Call SYSTEM command in SQR 04/04/2005 03:07 PM Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Hello, > $CMD = 'cd' ||$DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > It looks to me like the above would not even try to execute the 'cd' command, since there is no 'call system' between the first and second lines (which each assign $CMD to something). SQR variable names are not case-sensitive. I also see that in the call system command, it's using $syscmd - I don't know where that gets set, but it's not going to contain the cd or ls commands above. If 'cd' won't work in the program, you could try this: let $cmd = 'ls -lt ' $DataDirectory || '/SAMPLE.DAT >' || $DataDirectory || > $file_list call system using $cmd #unix_status There's no need to actually move to $DataDirectory if all you need is a listing of the sample.dat files within. Hope this helps! ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> yamuna_pandiyan@freddiemac.com 4/4/2005 2:12:32 PM >>> Yes there is a space in the cmd line , that was a typo in the below email, it should be - $CMD = 'cd' || ' ' || $DataDirectory Thanks, Yamuna 918-5127 "Prasanna Menta" To Sent by : "This list is for discussion about sqr-users-bounces+yamuna_pan the SQR database reporting language diyan=freddiemac.com@sqrug.o from Hyperion Solutions." rg cc 04/04/2005 02:06 Subject PM Re: [sqr-users] Call SYSTEM command in SQR Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." You have to know the structure of your unix file directory - Also you need a space between cd and $datadirectory $CMD = 'cd' || ' '|| $DataDirectory yamuna_pandiyan@freddiemac.com wrote: > > The following command works fine or the directory from where the SQR > program runs - '/shared/main/prog/sqr'. This command does not look for the > file in a different directory, i.e the data file resides in the data > directory - ' /shared/main/files/data/'. This is true if the command is > used with or without the predefined prefix variable. > > Example, I copied the data file from the above data directory to the SQR > directory and ran the program.The latest SAMPLE.DAT file name was written > into the filename defined in the '$file_list' variable. > > I did the cd command, $SqrDirectory = '/shared/main/prog/sqr' > $DataDirectory = '/shared/main/files/data/' > > $CMD = 'cd' ||$DataDirectory > $cmd = 'ls -lt SAMPLE.DAT >' || $DataDirectory || > $file_list > call system using $syscmd #unix_status > > I get the error - SAMPLE.DAT: No such file or directory > > But the above command works fine if I copy the SAMPLE.DAT file into the SQR > directory and use the following code, > > $cmd = 'ls -lt SAMPLE.DAT >' || ' ' || $file_list > call system using $syscmd #unix_status > > Could you help me how to use the 'cd' command with 'ls' command or how to > make the program to look for the data file in the data directory...? > > Thanks, > Yamuna > > > "Dattatraya > Shetty" > oo.com> "This list is for discussion about > the SQR database reporting language > Sent by : from Hyperion Solutions." > sqr-users-bounces+yamuna_pan > diyan=freddiemac.com@sqrug.o cc > rg > Subject > Re: [sqr-users] Call SYSTEM > 03/31/2005 01:25 command in SQR > PM > > > Please respond to > "This list is > for discussion > about the SQR > database > reporting > language from > Hyperion > Solutions." > .org> > > > > This fix is simple change the command to below > let $syscmd = 'ls -lts SAMPLE.DAT >' || $file_list > call system using $syscmd #unix_status > if #unix_status != 0 > stop quiet > end-if > > No need to Add the fileprefix to ls command. Its a Unix command and if > you add fileprefix to it the OS will try and execute the ls command > from the path in fileprefix which is wrong because the ls command is > not stored there. its some where in /usr/bin: > if you need to give the path then log into unix and issue the following > command > > $> whence ls > see the path displayed and use that. > > HTH > Datta. > > --- yamuna_pandiyan@freddiemac.com wrote: > > > > > Hi Datta, > > > > The sqr program resides in the ' /shared/main/prog/sqr' directory. > > The > > data file is created in the ' /shared/main/files/data/' directory. > > The > There > > is nothing wrong in the {FILEPREFIX} variable, since it woks fine > > with all > > other programs. > > > > But I am not able to debug, since I have limited knowledge on the > > Call > > System commands. When the below program is executed, the > > Latestfile.dat is > > created in the directory ' /shared/main/files/data/'. > > > > The error that is generated when executing the program is 'sh: > > /shared/main/files/data/ls : not found' if I use the below command. > > if I remove the {FILEPREFIX} from the command line, the following > > error is > > generated - '/shared/main/files/data/ : cannot execute' > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > > > "Dattatraya > > > > Shetty" > > > > > To > > oo.com> "This list is for discussion > > about > > the SQR database reporting > > language > > Sent by : from Hyperion Solutions." > > > > sqr-users-bounces+yamuna_pan > > > > diyan=freddiemac.com@sqrug.o > > cc > > rg > > > > > > Subject > > Re: [sqr-users] Call SYSTEM > > > > 03/30/2005 04:14 command in SQR > > > > PM > > > > > > > > > > > > Please respond to > > > > "This list is > > > > for discussion > > > > about the SQR > > > > database > > > > reporting > > > > language from > > > > Hyperion > > > > Solutions." > > > > > > > .org> > > > > > > > > > > > > > > > > > > > > Hi Yamuna, > > The Second part of the Problem is that FILEPREFIX may be an > > environment > > variable not defined? > > > > In the fist part the $ is missing for an environment variable. > > > > It would help if you let us know what is the excat command you are > > typing > > in at the command > > prompt. > > > > e.g > > > > $> ls -tls FMUBSOPT.DAT* > ${FILEPREFIX}Latestfile.dat > > is this what you are typing ? > > > > The fact that you are getting a file called Latestfile.dat tells me > > that > > the FILEPREFIX is not defined or you are not keying it correctly what > > is it > > ? > > > > HTH > > Datta. > > > > > > > > yamuna_pandiyan@freddiemac.com wrote: > > I am using a program which needs to compare the current data with the > > previous data file. the data files are created with date and time > > stamp. > > This program runs once a week, and has to compare the previous weeks > > data > > file to monitor the data changes. > > > > I am using the following command on the Unix box to sort the most > > recent > > file > > > > let $file_list = '{FILEPREFIX}Latestfile.dat' > > > > let $syscmd = '{FILEPREFIX}' || 'ls -lts SAMPLE.DAT >' || $file_list > > call system using $syscmd #unix_status > > if #unix_status != 0 > > stop quiet > > end-if > > > > The Latestfile.dat file is created in the data directory mentioned > > under > > {FILEPREFIX}. But the file is empty. I would like to send the result > > of the > > command > > ls -lts SAMPLE.DAT* to the above file. > > when I execute the above program in the unix server , I ge the > > following > > error - {FILEPREFIX} : cannot execute, but a blank file in the name > > of > > Latestfile.dat is created. > > > > any help in greatly appreciated. > > > > Thanks, > > Yamuna > > 918-5127 > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! Sports - Sign up for Fantasy Baseball. > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________ > Do you Yahoo!? > Yahoo! Personals - Better first dates. More second dates. > http://personals.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 04 18:41:20 2005 Date: Mon, 04 Apr 2005 16:40:40 -0700 From: David Donnelly Subject: [sqr-users] Re: Dynamic SQL vs. Fixed SQL execution Olga, After you use the -s SQR flag to check how many times statements are compiled, I would suggest that you hard-code the queries that you think are being constructed in one of your tests that seems to run a long time. In other words, if you think you are constructing let $where = 'where a.b = c.d' and use [$where] as dynamic where-clause, then actually hard-code the same clause and see how that runs. I guess you'll need to do this for all six dynamic queries. You might want to limit the size of the outer query result set (using loops=nnn) to less than "several thousand" while doing this. To be honest, I don't know if the queries are recompiled every time they're executed. The possibilities are (1)yes; (2) no; and (3) only if the contents of the dynamic clause is changed. You could test the latter, and if that turns out to be the case, then don't change the $where variable unless you need to. I have some vague memory of doing this, but I can't remember for sure. And finally, it is possible that the compiler doesn't have enough info to decide about indexes. One thing that is sometimes possible is to include "extra" predicates. For example, if you have a multi-field key, and your dynamic query selects a lower-level part of it, make sure the higher-level fields are all specified. And what about compiler hints -- might they be any help? I have never had to use them. Best of luck Dave _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 04:46:20 2005 Subject: Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution From: Wjatscheslaw KRAVTCHENKO Date: Tue, 5 Apr 2005 11:45:31 +0200 Dear Olga, as I said we had a similar problem with the performance of our reports, we rewrote the warehouse. Now we denormalize the data 4 times a day and serve the reports instantly. No joins, no aggregates, everything is precalculated. I think that by tuning SQL/SQR you'll not be able tosignificantly speed up the performance. At least we made this experience, which forced us to rethink the warehouse structure. Regards, ______________________________________ Wjatscheslaw Kravtchenko (Mr.) ProFi System Manager Assistant ProFi Technical Team Information Technology Service Division for Management United Nations Office on Drugs and Crime Tel: (+43-1) 26060-4153 Websites: www.unov.org, www.unodc.org ______________________________________ Impossible is not a fact, only an opinion Olga.Gal@bbh.com Sent by: sqr-users-bounces To +wjatscheslaw.kra "This list is for discussion about vtchenko=unvienna the SQR database reporting language .org@sqrug.org from Hyperion Solutions." cc Monday, 4 April 2005 18:22 Subject Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Dear Wjatscheslaw, To produce the report we access huge wide tables (millions of rows) that are joined by indexed columns. The queries are carefully tuned and executed fairly quickly outside the SQR. The processing starts with an outer (driving) query, which supposed to be the slowest one. It would return back thousands of rows, and then 90 percent of the selected rows are processed further: for each processed rows the SQR then selects additional information from 6 other queries that are dynamically constructed (dynamic SQL). These queries access the data by Primary Key, and are very fast when executed outside SQR. It takes over an hour to generate a report of about 650 such entities. By monitoring the progression of the report it looks like the driving query (the slowest one) is returning the list of entities fairly quickly, but it still takes too long to finish the report, which brought me to think that the problem is not really in the data access. Wjatscheslaw KRAVTCHENKO Sent by: sqr-users-bounces+olga.gal=bbh.com@sqrug.org To "This list is for discussion about the SQR database reporting language from Hyperion Solutions." 04/04/2005 11:50 AM cc Subject Please respond to Re: [sqr-users] Dynamic SQL vs. Fixed SQL execution "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Dear Olga, is the SQR forming the SQL slow or is the response from the database slow? How slow is it? Wha amount of data are we dealing with? We had a similar scenario on Sybase 12.5 transactional data. Do you have any samples of the SQL stmts ? How is the Warehouse structured? Anticipating your reply. ______________________________________ Wjatscheslaw Kravtchenko (Mr.) ProFi System Manager Assistant ProFi Technical Team Information Technology Service Division for Management United Nations Office on Drugs and Crime Tel: (+43-1) 26060-4153 Websites: www.unov.org, www.unodc.org ______________________________________ Impossible is not a fact, only an opinion Olga.Gal@bbh.com Sent by: sqr-users-bounces To +wjatscheslaw.kra sqr-users@sqrug.org vtchenko=unvienna cc .org@sqrug.org Subject [sqr-users] Dynamic SQL vs. Fixed Monday, 4 April SQL execution 2005 17:38 Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." We're using SQR ver 8.1 with Oracle 9i in the datawarehousing environment, which produce reports with huge amount of data and run VERY slow. Our SQR programs construct the Where clause and Order By clause dynamically, based on user's selection, and execute the same Select statement many times within the same job. This makes me think that the slow performance is possibly caused in part by repeating parsing of these dynamically constructed Select statements. Before taking a dramatic decision of changing the reports to have only fixed Select statements with bind variables ONLY in the Where clause, I would like to get assured that this approach will in fact eliminate unnecessary parsing (compilation) of SQL statements. My question is: Is the SQR compiling each SQL statement before executing it, or would it do it only for a newly executed SQL. In other words, if my program will repeatedly call a routine that executes a fixed SQL statement, will this statement get parsed every time it's being executed, or only the first time. Also, are there any other ways to speed up that time of processing? Any advice is greatly appreciated. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 10:35:03 2005 Date: Tue, 05 Apr 2005 11:34:23 -0400 From: Gina Bencke Subject: [sqr-users] Performance Issue with Oracle9i Good Morning, =A0 We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.=A0 We have a program that ran i= n < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.=A0 = We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.=A0 When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.=A0 =A0(Obviously changing the bind variable to a hard coded val= ue is not a work around, but simply a step in trying to understand the problem.) =A0 I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion. =A0 I have provided the code for the procedure whose performance is unacceptable below.=A0 However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.=A0 Also executing the join from SQL*Plus does not result in a performance issue.=A0=20 =A0 Has anyone else experienced a similar issue?=A0 Is there a environment parameter that may need to be set? =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 !*************************************************************************** *********** begin-procedure Get-Skip-Students=20 !*************************************************************************** *********** =A0 =A0=A0 let $Skip_Student =3D 'Y' =A0 begin-SELECT loops=3D1 JB.JOBCODE JC.JOB_FUNCTION =A0 =A0=A0 evaluate &JC.JOB_FUNCTION =A0=A0=A0=A0 when =3D 'STW' =A0=A0=A0=A0 when =3D 'GTA' =A0=A0=A0=A0 when =3D 'NTG' =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'Y'=A0=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0=A0 when-other=20 =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'N'=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0 end-evaluate =A0=A0=20 =A0 FROM=A0 PS_JOB JB, =A0=A0=A0=A0=A0 PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D $Old_Emplid =A0 AND JB.EMPL_RCD =3D 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB2.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EFFDT = <=3D $Quarter_End_Dt) =A0 AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB3.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EFFDT = =3D JB.EFFDT) =A0 AND JB.JOBCODE =3D JC.JOBCODE =A0 and JC.EFFDT=A0=A0 =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JC1.Jobcode= =3D JC.jobcode =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.effdt <= =3D JB.effdt =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.eff_Statu= s =3D 'A') end-SELECT =A0 end-procedure =A0 =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 10:55:26 2005 From: "Lynds,Rick" Subject: RE: [sqr-users] Performance Issue with Oracle9i Date: Tue, 5 Apr 2005 08:54:16 -0700 I noticed that you are not using SETID on the JOBCODE_TBL. That is the primary key field. Could it be that some quirk is causing the code to perform a table scan where it had not done so before? You can modify your join (and subquery) to join on JC.SETID =3D JB.SETID_JOBCODE HTH Rick=20 -----Original Message----- From: sqr-users-bounces+rlynds=3Dmwdh2o.com@sqrug.org [mailto:sqr-users-bounces+rlynds=3Dmwdh2o.com@sqrug.org] On Behalf Of Gina Bencke Sent: Tuesday, April 05, 2005 8:34 AM To: sqr-users@sqrug.org Subject: [sqr-users] Performance Issue with Oracle9i Good Morning, =A0 We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.=A0 We have a program that ran i= n < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.=A0 = We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.=A0 When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.=A0 =A0(Obviously changing the bind variable to a hard coded val= ue is not a work around, but simply a step in trying to understand the problem.) =A0 I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion. =A0 I have provided the code for the procedure whose performance is unacceptable below.=A0 However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.=A0 Also executing the join from SQL*Plus does not result in a performance issue.=A0=20 =A0 Has anyone else experienced a similar issue?=A0 Is there a environment parameter that may need to be set? =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 !*************************************************************************** *********** begin-procedure Get-Skip-Students !*************************************************************************** *********** =A0 =A0=A0 let $Skip_Student =3D 'Y' =A0 begin-SELECT loops=3D1 JB.JOBCODE JC.JOB_FUNCTION =A0 =A0=A0 evaluate &JC.JOB_FUNCTION =A0=A0=A0=A0 when =3D 'STW' =A0=A0=A0=A0 when =3D 'GTA' =A0=A0=A0=A0 when =3D 'NTG' =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'Y' =A0=A0=A0=A0=A0=A0 break =A0=A0=A0=A0 when-other =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'N'=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0 end-evaluate =A0=A0=20 =A0 FROM=A0 PS_JOB JB, =A0=A0=A0=A0=A0 PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D $Old_Emplid =A0 AND JB.EMPL_RCD =3D 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB2.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EFFDT = <=3D $Quarter_End_Dt) =A0 AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB3.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EFFDT = =3D JB.EFFDT) =A0 AND JB.JOBCODE =3D JC.JOBCODE =A0 and JC.EFFDT=A0=A0 =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JC1.Jobcode= =3D JC.jobcode =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.effdt <= =3D JB.effdt =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.eff_Statu= s =3D 'A') end-SELECT =A0 end-procedure =A0 =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 13:15:24 2005 Date: Tue, 05 Apr 2005 14:14:47 -0400 From: Gina Bencke Subject: RE: [sqr-users] Performance Issue with Oracle9i Thanks to a suggestion from Rick I modified the SQL to include setid in the where clause. (Btw Rick "AND JC.SETID =3D JB.SETID_JOBCODE" did not help but "AND JC.SETID =3D $SetID" did.) This alone was not enough but placed me on = the path to actually try tuning the SQL. I remember reading a paper on simple tuning techniques which suggests adding all keys in the select list to help Oracle select the most effective select path. Now the SQL runs faster than before. SELECT JB.EMPLID, JB.EMPL_RCD, JB.EFFDT, JB.EFFSEQ, JC.SETID, JC.JOBCODE, JC.EFFDT,=20 JB.JOBCODE, JC.JOB_FUNCTION FROM PS_JOB JB, PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D :1 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 where JB2.EMPLID =3D JB.EMPLID and JB2.EMPL_RCD =3D JB.EMPL_RCD and JB2.EFFDT <=3D to_date('03/31/2005','mm/dd/yyyy')) AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 where JB3.EMPLID =3D JB.EMPLID and JB3.EMPL_RCD =3D JB.EMPL_RCD and JB3.EFFDT =3D JB.EFFDT) AND JB.JOB_INDICATOR =3D 'P' AND JB.JOBCODE =3D JC.JOBCODE=20 AND JC.SETID =3D :2=20 and JC.EFFDT =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 where JC1.Jobcode =3D JC.jobcode and jc1.effdt <=3D JB.effdt and jc1.eff_Status =3D 'A') When I ran the original SQL in SQP*PLUS, I received the same result as I did from the SQR but in less than a second compared to 15 or 20 minutes in SQR. I still do not understand why Oracle would chose a vastly different execution plan in SQL*Plus and SQR. Can anyone shed light on this issue? Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Gi= na Bencke Sent: Tuesday, April 05, 2005 11:34 AM To: sqr-users@sqrug.org Subject: [sqr-users] Performance Issue with Oracle9i Good Morning, =A0 We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.=A0 We have a program that ran i= n < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.=A0 = We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.=A0 When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.=A0 =A0(Obviously changing the bind variable to a hard coded val= ue is not a work around, but simply a step in trying to understand the problem.) =A0 I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion. =A0 I have provided the code for the procedure whose performance is unacceptable below.=A0 However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.=A0 Also executing the join from SQL*Plus does not result in a performance issue.=A0=20 =A0 Has anyone else experienced a similar issue?=A0 Is there a environment parameter that may need to be set? =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 !*************************************************************************** *********** begin-procedure Get-Skip-Students=20 !*************************************************************************** *********** =A0 =A0=A0 let $Skip_Student =3D 'Y' =A0 begin-SELECT loops=3D1 JB.JOBCODE JC.JOB_FUNCTION =A0 =A0=A0 evaluate &JC.JOB_FUNCTION =A0=A0=A0=A0 when =3D 'STW' =A0=A0=A0=A0 when =3D 'GTA' =A0=A0=A0=A0 when =3D 'NTG' =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'Y'=A0=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0=A0 when-other=20 =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'N'=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0 end-evaluate =A0=A0=20 =A0 FROM=A0 PS_JOB JB, =A0=A0=A0=A0=A0 PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D $Old_Emplid =A0 AND JB.EMPL_RCD =3D 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB2.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EFFDT = <=3D $Quarter_End_Dt) =A0 AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB3.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EFFDT = =3D JB.EFFDT) =A0 AND JB.JOBCODE =3D JC.JOBCODE =A0 and JC.EFFDT=A0=A0 =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JC1.Jobcode= =3D JC.jobcode =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.effdt <= =3D JB.effdt =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.eff_Statu= s =3D 'A') end-SELECT =A0 end-procedure =A0 =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 13:27:12 2005 From: Bob Stone Subject: RE: [sqr-users] Performance Issue with Oracle9i Date: Tue, 5 Apr 2005 13:25:59 -0500 I dont know how often this particular SQL is running, but if it's running a lot there's a chance that it's reparsing it each time (which is slow). It might choose the fastest way to actually run the SQL, but if it has to rechoose that same way each time, that slows it down. One idea would be to do something about the date, because an actual string character and the 'to_date' function will most likely not be recognized as a bind variable. Then Oracle doesn't know that it's the exact same SQL line run other times in the program, and it will reparse it. If, earlier in the SQR, you make $quarter_date =3D '03-MAR-2005' (Oracle will recognize 'DD-MON-YYYY' as a d= ate for comparing) and then say AND JB2.EFFDT <=3D $quarter_date, that would be used as a bind variable. just an idea. -----Original Message----- From: sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org]On Behalf Of Gina Bencke Sent: Tuesday, April 05, 2005 1:15 PM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Performance Issue with Oracle9i Thanks to a suggestion from Rick I modified the SQL to include setid in the where clause. (Btw Rick "AND JC.SETID =3D JB.SETID_JOBCODE" did not help but "AND JC.SETID =3D $SetID" did.) This alone was not enough but placed me on = the path to actually try tuning the SQL. I remember reading a paper on simple tuning techniques which suggests adding all keys in the select list to help Oracle select the most effective select path. Now the SQL runs faster than before. SELECT JB.EMPLID, JB.EMPL_RCD, JB.EFFDT, JB.EFFSEQ, JC.SETID, JC.JOBCODE, JC.EFFDT,=20 JB.JOBCODE, JC.JOB_FUNCTION FROM PS_JOB JB, PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D :1 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 where JB2.EMPLID =3D JB.EMPLID and JB2.EMPL_RCD =3D JB.EMPL_RCD and JB2.EFFDT <=3D to_date('03/31/2005','mm/dd/yyyy')) AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 where JB3.EMPLID =3D JB.EMPLID and JB3.EMPL_RCD =3D JB.EMPL_RCD and JB3.EFFDT =3D JB.EFFDT) AND JB.JOB_INDICATOR =3D 'P' AND JB.JOBCODE =3D JC.JOBCODE=20 AND JC.SETID =3D :2=20 and JC.EFFDT =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 where JC1.Jobcode =3D JC.jobcode and jc1.effdt <=3D JB.effdt and jc1.eff_Status =3D 'A') When I ran the original SQL in SQP*PLUS, I received the same result as I did from the SQR but in less than a second compared to 15 or 20 minutes in SQR. I still do not understand why Oracle would chose a vastly different execution plan in SQL*Plus and SQR. Can anyone shed light on this issue? Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Gi= na Bencke Sent: Tuesday, April 05, 2005 11:34 AM To: sqr-users@sqrug.org Subject: [sqr-users] Performance Issue with Oracle9i Good Morning, =A0 We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.=A0 We have a program that ran i= n < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.=A0 = We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.=A0 When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.=A0 =A0(Obviously changing the bind variable to a hard coded val= ue is not a work around, but simply a step in trying to understand the problem.) =A0 I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion. =A0 I have provided the code for the procedure whose performance is unacceptable below.=A0 However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.=A0 Also executing the join from SQL*Plus does not result in a performance issue.=A0=20 =A0 Has anyone else experienced a similar issue?=A0 Is there a environment parameter that may need to be set? =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 !*************************************************************************** *********** begin-procedure Get-Skip-Students=20 !*************************************************************************** *********** =A0 =A0=A0 let $Skip_Student =3D 'Y' =A0 begin-SELECT loops=3D1 JB.JOBCODE JC.JOB_FUNCTION =A0 =A0=A0 evaluate &JC.JOB_FUNCTION =A0=A0=A0=A0 when =3D 'STW' =A0=A0=A0=A0 when =3D 'GTA' =A0=A0=A0=A0 when =3D 'NTG' =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'Y'=A0=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0=A0 when-other=20 =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'N'=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0 end-evaluate =A0=A0=20 =A0 FROM=A0 PS_JOB JB, =A0=A0=A0=A0=A0 PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D $Old_Emplid =A0 AND JB.EMPL_RCD =3D 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB2.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EFFDT = <=3D $Quarter_End_Dt) =A0 AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB3.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EFFDT = =3D JB.EFFDT) =A0 AND JB.JOBCODE =3D JC.JOBCODE =A0 and JC.EFFDT=A0=A0 =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JC1.Jobcode= =3D JC.jobcode =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.effdt <= =3D JB.effdt =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.eff_Statu= s =3D 'A') end-SELECT =A0 end-procedure =A0 =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 13:45:57 2005 From: "Alexander, Steve" Subject: RE: [sqr-users] Performance Issue with Oracle9i Date: Tue, 5 Apr 2005 11:43:32 -0700 I have two suggestions about your subquery to the PS_JOBCODE_TBL table that may improve performance and accuracy. First, you probably want the current row as of the $Quarter_End_Dt, not as of the Effdt of the PS_JOB row. Suppose I started a job a year ago and had no other changes in PS_JOB. Then the value of JOB_FUNCTION changed six months ago. Do you want the job function code that was in effect the last time I had a change in PS_JOB, or do you want the code in effect today? Second, you probably want the current row of the PS_JOBCODE_TBL, not the most recent row that was active. Alternately, you could use load-lookup to bring all the PS_JOB values of JOBCODE and all PS_JOBCODE_TBL values of JOB_FUNCTION into memory in one pass. If you can do that for PS_JOBCODE_TBL, you can avoid the join. If you can do that for PS_JOB, you avoid running the same SQL thousands of times. -----Original Message----- From: Bob Stone [mailto:bstone@fastenal.com] Sent: Tuesday, April 05, 2005 11:26 AM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] Performance Issue with Oracle9i I dont know how often this particular SQL is running, but if it's running a lot there's a chance that it's reparsing it each time (which is slow). It might choose the fastest way to actually run the SQL, but if it has to rechoose that same way each time, that slows it down. One idea would be to do something about the date, because an actual string character and the 'to_date' function will most likely not be recognized as a bind variable. Then Oracle doesn't know that it's the exact same SQL line run other times in the program, and it will reparse it. If, earlier in the SQR, you make $quarter_date = '03-MAR-2005' (Oracle will recognize 'DD-MON-YYYY' as a date for comparing) and then say AND JB2.EFFDT <= $quarter_date, that would be used as a bind variable. just an idea. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Gina Bencke Sent: Tuesday, April 05, 2005 1:15 PM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Performance Issue with Oracle9i Thanks to a suggestion from Rick I modified the SQL to include setid in the where clause. (Btw Rick "AND JC.SETID = JB.SETID_JOBCODE" did not help but "AND JC.SETID = $SetID" did.) This alone was not enough but placed me on the path to actually try tuning the SQL. I remember reading a paper on simple tuning techniques which suggests adding all keys in the select list to help Oracle select the most effective select path. Now the SQL runs faster than before. SELECT JB.EMPLID, JB.EMPL_RCD, JB.EFFDT, JB.EFFSEQ, JC.SETID, JC.JOBCODE, JC.EFFDT, JB.JOBCODE, JC.JOB_FUNCTION FROM PS_JOB JB, PS_JOBCODE_TBL JC WHERE JB.EMPLID = :1 AND JB.EFFDT = (Select MAX(JB2.EFFDT) from PS_JOB JB2 where JB2.EMPLID = JB.EMPLID and JB2.EMPL_RCD = JB.EMPL_RCD and JB2.EFFDT <= to_date('03/31/2005','mm/dd/yyyy')) AND JB.EFFSEQ = (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 where JB3.EMPLID = JB.EMPLID and JB3.EMPL_RCD = JB.EMPL_RCD and JB3.EFFDT = JB.EFFDT) AND JB.JOB_INDICATOR = 'P' AND JB.JOBCODE = JC.JOBCODE AND JC.SETID = :2 and JC.EFFDT = (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 where JC1.Jobcode = JC.jobcode and jc1.effdt <= JB.effdt and jc1.eff_Status = 'A') When I ran the original SQL in SQP*PLUS, I received the same result as I did from the SQR but in less than a second compared to 15 or 20 minutes in SQR. I still do not understand why Oracle would chose a vastly different execution plan in SQL*Plus and SQR. Can anyone shed light on this issue? Gina Bencke 216-875-9630 -----Original Message----- From: sqr-users-bounces+gina.work=bencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=bencke.com@sqrug.org] On Behalf Of Gina Bencke Sent: Tuesday, April 05, 2005 11:34 AM To: sqr-users@sqrug.org Subject: [sqr-users] Performance Issue with Oracle9i Good Morning,   We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.  We have a program that ran in < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.  We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.  When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.   (Obviously changing the bind variable to a hard coded value is not a work around, but simply a step in trying to understand the problem.)   I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion.   I have provided the code for the procedure whose performance is unacceptable below.  However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.  Also executing the join from SQL*Plus does not result in a performance issue.    Has anyone else experienced a similar issue?  Is there a environment parameter that may need to be set?   Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:    (216) 687-9200     !*************************************************************************** *********** begin-procedure Get-Skip-Students !*************************************************************************** ***********      let $Skip_Student = 'Y'   begin-SELECT loops=1 JB.JOBCODE JC.JOB_FUNCTION      evaluate &JC.JOB_FUNCTION      when = 'STW'      when = 'GTA'      when = 'NTG'        let $Skip_Student = 'Y'         break      when-other        let $Skip_Student = 'N'        break     end-evaluate      FROM  PS_JOB JB,       PS_JOBCODE_TBL JC WHERE JB.EMPLID = $Old_Emplid   AND JB.EMPL_RCD = 0                                                          !RK 02/19/2003   AND JB.EFFDT = (Select MAX(JB2.EFFDT) from PS_JOB JB2                    where JB2.EMPLID = JB.EMPLID                      and JB2.EMPL_RCD = JB.EMPL_RCD                            !RK 02/19/2003                      and JB2.EFFDT <= $Quarter_End_Dt)   AND JB.EFFSEQ = (Select MAX(JB3.EFFSEQ) from PS_JOB JB3                    where JB3.EMPLID = JB.EMPLID                      and JB3.EMPL_RCD = JB.EMPL_RCD                            !RK 02/19/2003                      and JB3.EFFDT = JB.EFFDT)   AND JB.JOBCODE = JC.JOBCODE   and JC.EFFDT   = (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1                     where JC1.Jobcode = JC.jobcode                     and jc1.effdt <= JB.effdt                     and jc1.eff_Status = 'A') end-SELECT   end-procedure     Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:    (216) 687-9200     _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 13:49:19 2005 Date: Tue, 05 Apr 2005 14:48:38 -0400 From: Gina Bencke Subject: RE: [sqr-users] Performance Issue with Oracle9i My original SQL does actually use a $quarter_end_date variable, I changed this in my test program simply because my testing showed that using a bind variable for $Emplid instead of a value (e.g. '123121001') resulted in hugely different execution times. I began focusing on the $Emplid and removing all other variables.=20=20 Thanks for reminding me to add back the use of $quarter_end_date!=20 Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Bob Stone Sent: Tuesday, April 05, 2005 2:26 PM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Performance Issue with Oracle9i I dont know how often this particular SQL is running, but if it's running a lot there's a chance that it's reparsing it each time (which is slow). It might choose the fastest way to actually run the SQL, but if it has to rechoose that same way each time, that slows it down. One idea would be to do something about the date, because an actual string character and the 'to_date' function will most likely not be recognized as a bind variable. Then Oracle doesn't know that it's the exact same SQL line run other times in the program, and it will reparse it. If, earlier in the SQR, you make $quarter_date =3D '03-MAR-2005' (Oracle will recognize 'DD-MON-YYYY' as a d= ate for comparing) and then say AND JB2.EFFDT <=3D $quarter_date, that would be used as a bind variable. just an idea. -----Original Message----- From: sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org]On Behalf Of Gina Bencke Sent: Tuesday, April 05, 2005 1:15 PM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Performance Issue with Oracle9i Thanks to a suggestion from Rick I modified the SQL to include setid in the where clause. (Btw Rick "AND JC.SETID =3D JB.SETID_JOBCODE" did not help but "AND JC.SETID =3D $SetID" did.) This alone was not enough but placed me on = the path to actually try tuning the SQL. I remember reading a paper on simple tuning techniques which suggests adding all keys in the select list to help Oracle select the most effective select path. Now the SQL runs faster than before. SELECT JB.EMPLID, JB.EMPL_RCD, JB.EFFDT, JB.EFFSEQ, JC.SETID, JC.JOBCODE, JC.EFFDT,=20 JB.JOBCODE, JC.JOB_FUNCTION FROM PS_JOB JB, PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D :1 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 where JB2.EMPLID =3D JB.EMPLID and JB2.EMPL_RCD =3D JB.EMPL_RCD and JB2.EFFDT <=3D to_date('03/31/2005','mm/dd/yyyy')) AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 where JB3.EMPLID =3D JB.EMPLID and JB3.EMPL_RCD =3D JB.EMPL_RCD and JB3.EFFDT =3D JB.EFFDT) AND JB.JOB_INDICATOR =3D 'P' AND JB.JOBCODE =3D JC.JOBCODE=20 AND JC.SETID =3D :2=20 and JC.EFFDT =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 where JC1.Jobcode =3D JC.jobcode and jc1.effdt <=3D JB.effdt and jc1.eff_Status =3D 'A') When I ran the original SQL in SQP*PLUS, I received the same result as I did from the SQR but in less than a second compared to 15 or 20 minutes in SQR. I still do not understand why Oracle would chose a vastly different execution plan in SQL*Plus and SQR. Can anyone shed light on this issue? Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Gi= na Bencke Sent: Tuesday, April 05, 2005 11:34 AM To: sqr-users@sqrug.org Subject: [sqr-users] Performance Issue with Oracle9i Good Morning, =A0 We are experiencing a strange performance issue with an SQR that worked efficiently prior to our Oracle 9i Upgrade.=A0 We have a program that ran i= n < 5 minutes under Oracle 8 which is taking several hours using Oracle 9i.=A0 = We have identified the specific procedure containing a Select Paragraph that runs slow but can not understand why.=A0 When the logic of the program is changed to call this procedure using a hard coded value for one of the bind variables (which happens to be one of the key fields) the performance issue disappears.=A0 =A0(Obviously changing the bind variable to a hard coded val= ue is not a work around, but simply a step in trying to understand the problem.) =A0 I was able to isolate the problem by writing a test program which simply sets the values of the bind variables and then calls this procedure and the poor performance is repeatable when isolated in this fashion. =A0 I have provided the code for the procedure whose performance is unacceptable below.=A0 However I do not think that the problem is in the join itself . Other programs which use the two tables found in the select paragraph are not experiencing poor performance.=A0 Also executing the join from SQL*Plus does not result in a performance issue.=A0=20 =A0 Has anyone else experienced a similar issue?=A0 Is there a environment parameter that may need to be set? =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 !*************************************************************************** *********** begin-procedure Get-Skip-Students=20 !*************************************************************************** *********** =A0 =A0=A0 let $Skip_Student =3D 'Y' =A0 begin-SELECT loops=3D1 JB.JOBCODE JC.JOB_FUNCTION =A0 =A0=A0 evaluate &JC.JOB_FUNCTION =A0=A0=A0=A0 when =3D 'STW' =A0=A0=A0=A0 when =3D 'GTA' =A0=A0=A0=A0 when =3D 'NTG' =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'Y'=A0=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0=A0 when-other=20 =A0=A0=A0=A0=A0=A0 let $Skip_Student =3D 'N'=20 =A0=A0=A0=A0=A0=A0 break =A0=A0=A0 end-evaluate =A0=A0=20 =A0 FROM=A0 PS_JOB JB, =A0=A0=A0=A0=A0 PS_JOBCODE_TBL JC WHERE JB.EMPLID =3D $Old_Emplid =A0 AND JB.EMPL_RCD =3D 0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0 AND JB.EFFDT =3D (Select MAX(JB2.EFFDT) from PS_JOB JB2 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB2.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB2.EFFDT = <=3D $Quarter_End_Dt) =A0 AND JB.EFFSEQ =3D (Select MAX(JB3.EFFSEQ) from PS_JOB JB3 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JB3.EMPLID =3D= JB.EMPLID =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EMPL_R= CD =3D JB.EMPL_RCD=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 !RK 02/19/2003 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and JB3.EFFDT = =3D JB.EFFDT) =A0 AND JB.JOBCODE =3D JC.JOBCODE =A0 and JC.EFFDT=A0=A0 =3D (select max(JC1.EFFDT) from ps_JOBCODE_TBL JC1 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 where JC1.Jobcode= =3D JC.jobcode =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.effdt <= =3D JB.effdt =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 and jc1.eff_Statu= s =3D 'A') end-SELECT =A0 end-procedure =A0 =A0 Gina Bencke Business Analyst Information Services & Technology Cleveland State University Phone: (216) 875-9630 Fax:=A0=A0=A0 (216) 687-9200 =A0 =A0 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 14:16:04 2005 Date: Tue, 05 Apr 2005 15:14:44 -0400 From: "George Jansen" Subject: RE: [sqr-users] Performance Issue with Oracle9i A suggestion to track down the issues between 8i and 9i: dump V$SQL_BIND_DA= TA: drop in a procedure in your select to see what is actually in use. I at= tach a file that can be included, with one procedure to call in your Begin-= Select paragraph, e.g. Begin-Select Z.col L.othercol dump_bind_data('bazball', 1) =46rom baz z, ball b Where .... End-Select ! dump_binds.sqc ! ! a procedure to dump the contents of v$sql_bind_data ! #define first_bind_dump_file_nbr 50000=20 #define max_bind_dumps_per_select 3 ! or however often you care to see i= t. ! ! Never called -- exists to ensure that the metadata array is created. ! Begin-Procedure create_bind_dump_array create-array name=3Dbind_dump_metadata size=3D50 field=3Dfileno:number field=3Drepeats:number field=3Dhas_been_opened:number field=3Dis_closed:number End-Procedure ! ! Called once per select to open the file and initialize array entries. ! Begin-Procedure setup_bind_dump($select_name, #select_nbr) let $file_name =3D '/tmp/' || $select_name || '.txt' let #fileno =3D {first_bind_dump_file_nbr} + #select_nbr open $file_name AS #fileno RECORD=3D1024:VARY FOR-WRITING put #fileno 0 1 INTO bind_dump_metadata(#select_nbr) fileno repeats has_b= een_o pened write #fileno from 'fileno:position:datatype:value' End-Procedure setup_bind_dump ! ! Once per select to close file and record it. ! Begin-Procedure cleanup_bind_dump(#select_nbr) get #fileno from bind_dump_metadata(#select_nbr) fileno close #fileno put 1 into bind_dump_metadata(#select_nbr) is_closed End-Procedure cleanup_bind_dump ! ! Called from dump_bind_data every time we wish to write. ! Begin-Procedure select_and_write_binds(#fileno) Begin-Select cursor_num &a position &b datatype &c value &d string &a &b &c &d by ':' into $pline write #fileno from $pline =46rom v$sql_bind_data Where value IS NOT NULL End-Select End-Procedure ! ! This is the only procedure to be called externally. ! Begin-Procedure dump_bind_data($select_name, #select_nbr) get #has_been_opened from bind_dump_metadata(#select_nbr) fileno if #has_been_opened =3D 0 Do setup_bind_dump($select_name, #select_nbr)=20=20 end-if get #fileno #repeats FROM bind_dump_metadata(#select_nbr) fileno repeats if #repeats < {max_bind_dumps_per_select} Do select_and_write_binds(#fileno) let #repeats =3D #repeats + 1 put #repeats into bind_dump_metadata(#select_nbr) repeats else get #is_closed from bind_dump_metadata(#select_nbr) is_closed if #is_closed =3D 0 Do cleanup_bind_dump(#select_nbr) end-if end-if End-Procedure _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 16:40:17 2005 Date: Tue, 5 Apr 2005 17:39:36 -0400 From: "Debbie Larney" Subject: [sqr-users] Dynamic database links Hello Everyone, I was wondering if it was possible to dynamically define database links in = sqr. I am trying to access a vendor's database via a database link. I know = that the database link is set up properly because if I hardcode the link na= me in my sql statement I am able to run my program to success. The problem = I have is that I want to define this value dynamically based on run control= parameters. I get compile errrors when I try this dynamically because the = database link variable name is not determined until after the program compi= les. I presume I could define the tables in the database that I am executing my = program from but I really don't want to have to do that. Anyone have any gr= eat ideas. Snippets of my code and the errors from the log file are listed below. Than= ks in advance for any assistance --Definition of the database link if $kronos_db =3D 'KPRD' let $dblink =3D {dblink_kprd}--This is defined gloablly else if $kronos_db =3D 'KTST' let $dblink =3D {dblink_ktst}--This is defined gloablly else if $kronos_db =3D 'KDEV' let $dblink =3D {dblink_kdev}--This is defined gloablly else if $kronos_db =3D 'KSYS' let $dblink =3D {dblink_ksys}--This is defined gloablly =20 end-if end-if end-if end-if=20 --One of the procedures with a compile error !--------------------------------------------------------------------------= ---! ! Procedure : Check-New-BU ! Called From: Get-RC-Params ! Description: Checks to see if payrules already exist for the selected=20 ! clone to bu !--------------------------------------------------------------------------= ---! begin-procedure Check-New-BU move 'Check-New-BU' to $operation_name #ifdef debugf show 'Procedure: ' $operation_name #end-if let $found_new_bu =3D 'N' begin-select loops=3D1 a.name=20=20 Let $found_new_bu =3D 'Y' show 'Error: new BU payrules already exist =3D ' $new_bu from payruleids [$dblink] a=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 where substr(a.name,1,5) =3D $new_bu=20 End-Select end-procedure Check-New-BU error below notice that the dblink is not defined at compile time and not p= art of the sql SQR 5528) ORACLE OCIStmtExecute error 942 in cursor 32:=20 ORA-00942: table or view does not exist=20 SQL: SELECT a.name from payruleids=20 Error on line 260: (SQR 3716) Error in SQL statement.=20 ********************************************************************=20 CONFIDENTIALITY NOTICE:=20 The information contained in this e-mail is legally privileged and confiden= tial information intended only for the use of the individual or entity to w= hom it is addressed. If the reader of this message is not the intended rec= ipient, you are hereby notified that any viewing, dissemination, distributi= on, or copying of this e-mail message is strictly prohibited. If you have = received and/or are viewing this e-mail in error, please immediately notify= the sender by reply e-mail, and delete this e-mail from your system. Thank you.=20 ********************************************************************=20 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 16:55:39 2005 From: Bob Stone Subject: RE: [sqr-users] Dynamic database links Date: Tue, 5 Apr 2005 16:54:32 -0500 I've got 2 different ideas for you. First, maybe try letting $dblink default to something you know will work before all the if statements (it's def on KDEV so 'let $dblink = 'KDEV' ' and then change it once you know what $kronos_db is). That way it compiles knowing that $dblink will have a value. As is, it looks like all the ifs could fail, and then $dblink has no value/doesn't exist. I'm speaking in terms of possibility...even though you may NEVER have a value other than those 4, there is no 'else !other ' statement that ensures the compiler that $dblink is set in one of those checks. Second, now I've never tried this, but maybe you could make the entire from clause dynamically. That way it will have to parse it at run time instead of compile time? maybe? (i could be wrong on this...dynamic from clauses isn't something I've tried). Just a suggestion...something to try. let $from_clause = 'FROM payruleids ' || $dblink || ' a' begin-select loops=1 a.name Let $found_new_bu = 'Y' [$from_clause] where ... end-select -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Debbie Larney Sent: Tuesday, April 05, 2005 4:40 PM To: sqr-users@sqrug.org Subject: [sqr-users] Dynamic database links Hello Everyone, I was wondering if it was possible to dynamically define database links in sqr. I am trying to access a vendor's database via a database link. I know that the database link is set up properly because if I hardcode the link name in my sql statement I am able to run my program to success. The problem I have is that I want to define this value dynamically based on run control parameters. I get compile errrors when I try this dynamically because the database link variable name is not determined until after the program compiles. I presume I could define the tables in the database that I am executing my program from but I really don't want to have to do that. Anyone have any great ideas. Snippets of my code and the errors from the log file are listed below. Thanks in advance for any assistance --Definition of the database link if $kronos_db = 'KPRD' let $dblink = {dblink_kprd}--This is defined gloablly else if $kronos_db = 'KTST' let $dblink = {dblink_ktst}--This is defined gloablly else if $kronos_db = 'KDEV' let $dblink = {dblink_kdev}--This is defined gloablly else if $kronos_db = 'KSYS' let $dblink = {dblink_ksys}--This is defined gloablly end-if end-if end-if end-if --One of the procedures with a compile error !--------------------------------------------------------------------------- --! ! Procedure : Check-New-BU ! Called From: Get-RC-Params ! Description: Checks to see if payrules already exist for the selected ! clone to bu !--------------------------------------------------------------------------- --! begin-procedure Check-New-BU move 'Check-New-BU' to $operation_name #ifdef debugf show 'Procedure: ' $operation_name #end-if let $found_new_bu = 'N' begin-select loops=1 a.name Let $found_new_bu = 'Y' show 'Error: new BU payrules already exist = ' $new_bu from payruleids [$dblink] a where substr(a.name,1,5) = $new_bu End-Select end-procedure Check-New-BU error below notice that the dblink is not defined at compile time and not part of the sql SQR 5528) ORACLE OCIStmtExecute error 942 in cursor 32: ORA-00942: table or view does not exist SQL: SELECT a.name from payruleids Error on line 260: (SQR 3716) Error in SQL statement. ******************************************************************** CONFIDENTIALITY NOTICE: The information contained in this e-mail is legally privileged and confidential information intended only for the use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any viewing, dissemination, distribution, or copying of this e-mail message is strictly prohibited. If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete this e-mail from your system. Thank you. ******************************************************************** _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 17:11:18 2005 From: Gregory Jacobs Date: Tue, 5 Apr 2005 15:10:08 -0700 Subject: [sqr-users] SQR v8.3.2 and Email After reviewing much of the information concerning SQR and email, I realized this issue could/should be re-addressed. We are preparing to implement SQR v8.3.2 as part of the Hyperion Performance Suite. We need to provide the ability to send email out of the SQR application, so here are the questions. 1) Can we use Outlook as the mail client? If so, what else to I nee to do to make this work? 2) What the names of some 'FREE' email clients. We are running on a Windows Server 2003 platform. and have the need to send attachments with the emails. Please feel free to offer your help, opinion, etc. Regards, Greg Jacobs Business Systems Analyst, Sr. BAX Global 440 Exchange Irvine, CA 92602 714-442-7528 "At Your Service" _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 05 18:26:48 2005 From: "Alexander, Steve" Subject: RE: [sqr-users] Dynamic database links Date: Tue, 5 Apr 2005 16:25:18 -0700 In Oracle, tables that are accessed via a database link are written in the form "payruleids@kdev". It may be different in other databases, but I suspect you cannot have a space between the table name and the database instance name. Also, the SQR compiler wants to validate your fields, so it needs to know a table with the same layout as your dynamically selected table. You might write the FROM clause as: from [$table_at_db : payruleids@kdev] a That tells SQR to use the copy of payruleids in the kdev database instance to determine whether your fields are valid and what type they are. If you are not always connected to kdev (or any instance that includes payruleids), you can identify the type of each field - but I forget the syntax. -----Original Message----- From: Bob Stone [mailto:bstone@fastenal.com] Sent: Tuesday, April 05, 2005 2:55 PM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] Dynamic database links I've got 2 different ideas for you. First, maybe try letting $dblink default to something you know will work before all the if statements (it's def on KDEV so 'let $dblink = 'KDEV' ' and then change it once you know what $kronos_db is). That way it compiles knowing that $dblink will have a value. As is, it looks like all the ifs could fail, and then $dblink has no value/doesn't exist. I'm speaking in terms of possibility...even though you may NEVER have a value other than those 4, there is no 'else !other ' statement that ensures the compiler that $dblink is set in one of those checks. Second, now I've never tried this, but maybe you could make the entire from clause dynamically. That way it will have to parse it at run time instead of compile time? maybe? (i could be wrong on this...dynamic from clauses isn't something I've tried). Just a suggestion...something to try. let $from_clause = 'FROM payruleids ' || $dblink || ' a' begin-select loops=1 a.name Let $found_new_bu = 'Y' [$from_clause] where ... end-select -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Debbie Larney Sent: Tuesday, April 05, 2005 4:40 PM To: sqr-users@sqrug.org Subject: [sqr-users] Dynamic database links Hello Everyone, I was wondering if it was possible to dynamically define database links in sqr. I am trying to access a vendor's database via a database link. I know that the database link is set up properly because if I hardcode the link name in my sql statement I am able to run my program to success. The problem I have is that I want to define this value dynamically based on run control parameters. I get compile errrors when I try this dynamically because the database link variable name is not determined until after the program compiles. I presume I could define the tables in the database that I am executing my program from but I really don't want to have to do that. Anyone have any great ideas. Snippets of my code and the errors from the log file are listed below. Thanks in advance for any assistance --Definition of the database link if $kronos_db = 'KPRD' let $dblink = {dblink_kprd}--This is defined gloablly else if $kronos_db = 'KTST' let $dblink = {dblink_ktst}--This is defined gloablly else if $kronos_db = 'KDEV' let $dblink = {dblink_kdev}--This is defined gloablly else if $kronos_db = 'KSYS' let $dblink = {dblink_ksys}--This is defined gloablly end-if end-if end-if end-if --One of the procedures with a compile error !--------------------------------------------------------------------------- --! ! Procedure : Check-New-BU ! Called From: Get-RC-Params ! Description: Checks to see if payrules already exist for the selected ! clone to bu !--------------------------------------------------------------------------- --! begin-procedure Check-New-BU move 'Check-New-BU' to $operation_name #ifdef debugf show 'Procedure: ' $operation_name #end-if let $found_new_bu = 'N' begin-select loops=1 a.name Let $found_new_bu = 'Y' show 'Error: new BU payrules already exist = ' $new_bu from payruleids [$dblink] a where substr(a.name,1,5) = $new_bu End-Select end-procedure Check-New-BU error below notice that the dblink is not defined at compile time and not part of the sql SQR 5528) ORACLE OCIStmtExecute error 942 in cursor 32: ORA-00942: table or view does not exist SQL: SELECT a.name from payruleids Error on line 260: (SQR 3716) Error in SQL statement. ******************************************************************** CONFIDENTIALITY NOTICE: The information contained in this e-mail is legally privileged and confidential information intended only for the use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any viewing, dissemination, distribution, or copying of this e-mail message is strictly prohibited. If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete this e-mail from your system. Thank you. ******************************************************************** _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 04:14:32 2005 From: "Steve Cavill" Subject: RE: [sqr-users] SQR v8.3.2 and Email Date: Wed, 6 Apr 2005 19:11:33 +1000 Hi Greg, When you say "SQR v8.3.2 as part of the Hyperion Performance Suite" do you mean you have SQR iServer? In which case it may be much easier to use the built in email notification system of HPSu instead of writing your own calls to call email. You need a mail server., not a mail client, like Microsoft Exchange, or an SMTP mail server. Search for SMTP mail server on download.com or similar. Cheers, Steve. -----Original Message----- From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org [mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] On Behalf Of Gregory Jacobs Sent: Wednesday, 6 April 2005 8:10 AM To: sqr-users@sqrug.org Subject: [sqr-users] SQR v8.3.2 and Email After reviewing much of the information concerning SQR and email, I realized this issue could/should be re-addressed. We are preparing to implement SQR v8.3.2 as part of the Hyperion Performance Suite. We need to provide the ability to send email out of the SQR application, so here are the questions. 1) Can we use Outlook as the mail client? If so, what else to I nee to do to make this work? 2) What the names of some 'FREE' email clients. We are running on a Windows Server 2003 platform. and have the need to send attachments with the emails. Please feel free to offer your help, opinion, etc. Regards, Greg Jacobs Business Systems Analyst, Sr. BAX Global 440 Exchange Irvine, CA 92602 714-442-7528 "At Your Service" _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 11:07:44 2005 Date: Wed, 6 Apr 2005 09:06:59 -0700 (PDT) From: "fpickava@earthlink.net" Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, > > I am going to a client site that does not have SQRW installed. They develop SQR's in text and submit for execution via native Unix (ugly). How do I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 11:26:41 2005 Date: Wed, 6 Apr 2005 09:25:34 -0700 From: Robert Goshko Subject: Re: [sqr-users] SQRW Question On Apr 6, 2005 9:06 AM, fpickava@earthlink.net wrote: > Is there some way an Array can be sorted? Yes, you can use any type of algorithm, you just have to code it yourself, I have coded a simple bubble sort before, not the best or fastest, but fairly simple to code. You can find various sorting algorithms around the web -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 11:29:42 2005 From: "Alexander, Steve" Subject: RE: [sqr-users] SQRW Question Date: Wed, 6 Apr 2005 09:27:01 -0700 Alas, there is no command in SQR to sort arrays, despite many requests to Brio/Hyperion for that feature. You have to write your own sorting subroutine. There are many ways to do that, and the best approach may depend on the situation. Do you have a specific problem to solve? -----Original Message----- From: fpickava@earthlink.net [mailto:fpickava@earthlink.net] Sent: Wednesday, April 06, 2005 9:07 AM To: This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions.; This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions. Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, > > I am going to a client site that does not have SQRW installed. They develop SQR's in text and submit for execution via native Unix (ugly). How do I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 12:06:27 2005 Date: Wed, 6 Apr 2005 13:05:37 -0400 (GMT-04:00) From: "fpickava@earthlink.net" Subject: Re: [sqr-users] SQRW Question Thanks. Please send me your simple bubble sort code. During unit testing I will try to improve on the performance and send the code back to you.....Frank -----Original Message----- From: Robert Goshko Sent: Apr 6, 2005 12:25 PM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Apr 6, 2005 9:06 AM, fpickava@earthlink.net wrote: > Is there some way an Array can be sorted? Yes, you can use any type of algorithm, you just have to code it yourself, I have coded a simple bubble sort before, not the best or fastest, but fairly simple to code. You can find various sorting algorithms around the web -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 12:13:07 2005 Subject: RE: [sqr-users] SQRW Question Date: Wed, 6 Apr 2005 11:11:54 -0600 From: "Bartlett, Dwain" This is a multi-part message in MIME format... ------_=_NextPart_001_01C53ACB.BB1E964F Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Attached is code for sorting an array. Dwain Bartlett SABHRS Services Bureau, ITSD HR Systems Analyst (406) 444-0418 dbartlett@mt.gov -----Original Message----- From: sqr-users-bounces+dbartlett=3Dmt.gov@sqrug.org [mailto:sqr-users-bounces+dbartlett=3Dmt.gov@sqrug.org]On Behalf Of fpickava@earthlink.net Sent: Wednesday, April 06, 2005 10:07 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions.; This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, >=20 > I am going to a client site that does not have SQRW installed. They deve= lop SQR's in text and submit for execution via native Unix (ugly). How do = I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. --=20 ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ------_=_NextPart_001_01C53ACB.BB1E964F Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Description: AUTOMATIC WARNING Here was a non admissible message part of 'application/octet-stream' MIME type. It has been automatically discarded before sending the message to the list. ------_=_NextPart_001_01C53ACB.BB1E964F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ------_=_NextPart_001_01C53ACB.BB1E964F-- From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 12:18:03 2005 Subject: RE: [sqr-users] SQRW Question Date: Wed, 6 Apr 2005 11:16:51 -0600 From: "Bartlett, Dwain" The attachment did get sent, so here is the code. !********************************************************************** !* * !* MODULE: TDSORTR.SQR * !* AUTHOR: TONY DELIA. * !* DATE: 03/01/1999. * !* SYSTEM: TD SQR UTILITY SERIES. * !* DESC: SQR RECURSIVE SORT EXPLANATION (QUICKSORT). * !* * !********************************************************************** !* * !* NOTE: THIS SAMPLE EXPANDS ON THE SQR TUTORIAL PROGRAM * !* EX24A.SQR (QUICKSORT SAMPLE CODE). THE QUICKSORT * !* ALGORITHM IS COMMONLY UTILIZED IN C, BASIC, JAVA, * !* ETC. BUT NOT COMMONLY UNDERSTOOD. SOME STRUCTURAL * !* CHANGES HAVE BEEN MADE TO THE QUICKSORT ROUTINE * !* AS FOLLOWS: * !* * !* A) ALLOW MULTIPLE SORT KEYS TO BE USED. * !* * !* EXAMPLE USES STATE AND AREA CODE AS KEYS. * !* * !* B) SENSIBLE POINTER NAMES REPLACING #m, #n, #i, #j. * !* * !* #qlo - LO ARRAY BOUNDARY. * !* #qhi - HI ARRAY BOUNDARY. * !* #qbwd - BACKWARD TRAVERSAL POINTER. * !* #qfwd - FORWARD TRAVERSAL POINTER. * !* * !* C) CHANGED MISLEADING POINTER LIMIT ON BACKWARD * !* TRAVERSAL. EX24A.SQR USES STATEMENT... * !* * !* while #j >=3D 0 TO CONTROL BACKWARD TRAVERSAL. * !* * !* THIS IMPLIES BACKWARD TRAVERSAL GOES THROUGH THE * !* START OF ARRAY. ACTUALLY THE BACKWARD TRAVERSAL * !* ENDS WHEN IT INTERSECTS WITH FORWARD POINTER. * !* BESIDES WHEN 2ND RECURSIVE SORT IS CALLED WITHIN * !* THE 'PARENT' SORT THE LO BOUNDARY IS NEVER ZERO. * !* * !* D) FURTHER CLARIFIED CODE ON FINAL SWAP. CURRENTLY * !* LO/BWD SWAP IS UNCONDITIONAL. IF ELEMENTS ARE IN * !* THEIR PROPER PLACE THERE'S NO NEED TO SWAP. ALSO * !* STREAMLINED RECURSIVE ARRAY POPULATION A BIT. * !* * !* E) COMMENTS INSERTED TO EXPLAIN FUNCTIONALITY OF * !* PROGRAM. * !* * !********************************************************************** !* * !* OVERVIEW: THE RECURSIVE 'QUICKSORT' PERFORMS SEVERAL TASKS. * !* NOTE THE FIRST ELEMENT IS USED AS THE 'OBJECT' KEY. * !* LO AND HI ARRAY BOUNDARIES ARE PASSED TO THE SORT. * !* * !* THE FIRST STEP USES A FORWARD POINTER TO FIND THE * !* 'NEXT' ELEMENT > OBJECT KEY. THEN STARTING FROM THE * !* HI BOUNDARY A BACKWARD POINTER IS USED TO FIND THE * !* 'NEXT' ELEMENT < OBJECT KEY. THE FWD AND BWD ARRAY * !* ELEMENTS MAY THEN BE SWAPPED. THIS IS BASED ON THE * !* SIMPLE ALGEBRAIC RULE: * !* * !* IF (KEY < FWD) AND (KEY > BWD) THEN (FWD > BWD). * !* * !* ABOVE PROCESS REPEATED UNTIL FWD/BWD POINTERS * !* INTERSECT. ONCE COMPLETE A FINAL SWAP 'MAY' BE * !* REQUIRED BETWEEN THE OBJECT KEY (LO) AND BACKWARD * !* POINTER. AT THIS POINT THE BACKWARD POINTER IS USED * !* AS A TABLE DIVIDER. FOR BOTH SECTIONS THE RECURSIVE * !* SORT IS PERFORMED AGAIN USING THE SECTION LO/HI * !* BOUNDARIES. SINCE SQR DOES NOT SUPPORT RECURSIVE * !* VARIABLES AN ARRAY IS USED TO STORE LO/HI BOUNDARY * !* PARAMETERS FOR THE SECOND HALF OF THE TABLE (THE * !* FIRST SECTION IS CALLED IMMEDIATELY). * !* * !* GRAPHIC: * !* ---------------------------------------------- * !* LEVEL LO FWD-> <-BWD HI * !* #1 0 1 2 3 4 5 6 . . . . n * !* /| * !* --------------------- ---------------------- * !* LEVEL LO FWD-> <-BWD HI LO FWD-> <-BWD HI * !* #2 0 1 2 3 4 5 6 . . . . n * !* /| /| * !* etc. etc. etc. etc. * !* --------- --------- --------- ---------- * !* #3 0 1 2 3 4 5 6 . . . . n * !* * !********************************************************************** !* * !* SEE TDSORTR.ALC FOR IBM/370 ASSEMBLER VERSION OF * !* RECURSIVE SORTING. COMMENTS GIVEN FOR EACH LINE. * !* SAME STATE/AREACODE/DESCRIPTION ARRAY USED IN BOTH * !* ASSEMBLER AND SQR VERSIONS. * !* * !********************************************************************** #include 'setenv.sqc' ! Set environment !********************************************************************** !* Setup Procedure * !********************************************************************** begin-setup #Include 'setup02a.sqc' ! Printer and page-size init landscape #define max_rows 5000 end-setup !********************************************************************** !* Mainline Processing * !********************************************************************** begin-report do Init-DateTime do Get-Current-DateTime move $AsOfToday to $AsOfDate do Process-Main end-report !********************************************************************** !* Set Defaults * !********************************************************************** begin-procedure Set-Defaults let $ReportId =3D 'TDSORTR' let $ReportTitle =3D 'SQR Recursive Sort (QuickSort)' display $ReportId noline display ' ' noline display $ReportTitle display ' ' end-procedure !********************************************************************** !* Process Main * !********************************************************************** begin-procedure Process-Main create-array name=3DQsort size=3D{max_rows} field=3DQlo:number field=3DQhi:number create-array name=3DQarray size=3D{max_rows} field=3DQkey:char field=3DQarea:char field=3DQdesc:char do Load-Array do QuickSort(0, 0, #Qmax) do Display-Results end-procedure !********************************************************************** !* Recursive Sort * !********************************************************************** begin-procedure QuickSort(#level, #Qlo, #Qhi) if #Qlo < #Qhi let #Qfwd =3D #Qlo ! Init forward pointer let #Qbwd =3D #Qhi + 1 ! Init backward pointer ! Lo Boundary is Key Object(s) let $Qkey =3D Qarray.Qkey (#Qlo) let $Qarea =3D Qarray.Qarea (#Qlo) while 1 =3D 1 ! Traverse Forward - find 'next' array.key > Qkey ! Bypass all keys less than Object Key (Qkey) let #Qfwd =3D #Qfwd + 1 while #Qfwd <=3D #Qbwd if $Qkey < Qarray.Qkey (#Qfwd) or $Qkey =3D Qarray.Qkey (#Qfwd) and $Qarea < Qarray.Qarea (#Qfwd) break end-if let #Qfwd =3D #Qfwd + 1 end-while ! Traverse Backward - find 'next' array.key < Qkey ! Bypass all keys more than Object Key (Qkey) let #Qbwd =3D #Qbwd - 1 while #Qbwd >=3D #Qfwd ! Logically #Qfwd is limit if $Qkey > Qarray.Qkey (#Qbwd) or $Qkey =3D Qarray.Qkey (#Qbwd) and $Qarea > Qarray.Qarea (#Qbwd) break end-if let #Qbwd =3D #Qbwd - 1 end-while ! Once traversed Boundaries meet exit main loop if #Qfwd >=3D #Qbwd break end-if ! Swap Forward/Backward Elements do QSortSwap(#Qfwd, #Qbwd) end-while ! Swap Lo Boundary / Backward Elements if $Qkey > Qarray.Qkey (#Qbwd) or $Qkey =3D Qarray.Qkey (#Qbwd) and $Qarea > Qarray.Qarea (#Qbwd) do QSortSwap(#Qlo, #Qbwd) end-if ! At this point the table is split in two sections. ! Save boundaries of 2nd half (due to non-recursive variables) let #level =3D #level + 1 let Qsort.Qlo (#level - 1) =3D #Qbwd + 1 let Qsort.Qhi (#level - 1) =3D #Qhi ! Now sort from Lo to New Hi let #Qhi =3D #Qbwd - 1 do QuickSort(#level, #Qlo, #Qhi) ! Now sort from New Lo to Hi (Restoring first) let #Qlo =3D Qsort.Qlo (#level - 1) let #Qhi =3D Qsort.Qhi (#level - 1) do QuickSort(#level, #Qlo, #Qhi) let #level =3D #level - 1 end-if end-procedure !********************************************************************** !* Sort Lo/Hi Array Elements * !********************************************************************** begin-procedure QSortSwap(#lo, #hi) get $Qkey $Qarea $Qdesc from Qarray (#lo) Qkey Qarea Qdesc let Qarray.Qkey (#lo) =3D Qarray.Qkey (#hi) let Qarray.Qarea (#lo) =3D Qarray.Qarea (#hi) let Qarray.Qdesc (#lo) =3D Qarray.Qdesc (#hi) put $Qkey $Qarea $Qdesc into Qarray (#hi) Qkey Qarea Qdesc end-procedure !********************************************************************** !* Load Array * !********************************************************************** begin-procedure Load-Array let #idx =3D 0 let $Qdata =3D 'AK907ALASKA' do Load-Element let $Qdata =3D 'DE302DELAWARE' do Load-Element let $Qdata =3D 'GA404GEORGIA' do Load-Element let $Qdata =3D 'GA706GEORGIA' do Load-Element let $Qdata =3D 'MD301MARYLAND' do Load-Element let $Qdata =3D 'NJ201NEW JERSEY' do Load-Element let $Qdata =3D 'WA206WASHINGTON' do Load-Element let $Qdata =3D 'NY607NEW YORK' do Load-Element let $Qdata =3D 'NJ908NEW JERSEY' do Load-Element let $Qdata =3D 'NJ609NEW JERSEY' do Load-Element let $Qdata =3D 'WA509WASHINGTON' do Load-Element let $Qdata =3D 'MD410MARYLAND' do Load-Element let $Qdata =3D 'PA610PENNSYLVANIA' do Load-Element let $Qdata =3D 'GA912GEORGIA' do Load-Element let $Qdata =3D 'NY212NEW YORK' do Load-Element let $Qdata =3D 'PA412PENNSYLVANIA' do Load-Element let $Qdata =3D 'NY914NEW YORK' do Load-Element let $Qdata =3D 'PA814PENNSYLVANIA' do Load-Element let $Qdata =3D 'NY315NEW YORK' do Load-Element let $Qdata =3D 'NY516NEW YORK' do Load-Element let $Qdata =3D 'NY716NEW YORK' do Load-Element let $Qdata =3D 'NY917NEW YORK' do Load-Element let $Qdata =3D 'NY917MANHATTEN' do Load-Element let $Qdata =3D 'PA215PENNSYLVANIA' do Load-Element let $Qdata =3D 'PA717PENNSYLVANIA' do Load-Element let $Qdata =3D 'NY518NEW YORK' do Load-Element let $Qdata =3D 'NY718NEW YORK' do Load-Element let $Qdata =3D 'PA724PENNSYLVANIA' do Load-Element let $Qdata =3D 'NJ732NEW JERSEY' do Load-Element let $Qdata =3D 'MD240MARYLAND' do Load-Element let $Qdata =3D 'MD443MARYLAND' do Load-Element let $Qdata =3D 'WA360WASHINGTON' do Load-Element let $Qdata =3D 'GA770GEORGIA' do Load-Element let $Qdata =3D 'NJ973NEW JERSEY' do Load-Element let $Qdata =3D 'GA678GEORGIA' do Load-Element let #Qmax =3D #idx - 1 end-procedure !********************************************************************** !* Load Element * !********************************************************************** begin-procedure Load-Element let Qarray.Qkey (#idx) =3D substr($Qdata,1,2) let Qarray.Qarea (#idx) =3D substr($Qdata,3,3) let Qarray.Qdesc (#idx) =3D rtrim(substr($Qdata,6,20),' ') let #idx =3D #idx + 1 end-procedure !********************************************************************** !* Display Results * !********************************************************************** begin-procedure Display-Results display ' ' display 'Sorted Results' display ' ' display 'State Area Description' display '----- ---- --------------------' display ' ' let #idx =3D 0 while #idx <=3D #Qmax let $Qkey =3D Qarray.Qkey (#idx) let $Qarea =3D Qarray.Qarea (#idx) let $Qdesc =3D Qarray.Qdesc (#idx) let $Qdata =3D rpad($Qkey,7,' ') || rpad($Qarea,6,' ') || $Qdesc display $Qdata let #idx =3D #idx + 1 end-while display ' ' end-procedure !********************************************************************** !* Include Members: * !********************************************************************** #Include 'curdttim.sqc' !Get-Current-DateTime procedure #Include 'datetime.sqc' !Routines for date and time formatting !Init-DateTime procedure Dwain Bartlett SABHRS Services Bureau, ITSD HR Systems Analyst (406) 444-0418 dbartlett@mt.gov -----Original Message----- From: sqr-users-bounces+dbartlett=3Dmt.gov@sqrug.org [mailto:sqr-users-bounces+dbartlett=3Dmt.gov@sqrug.org]On Behalf Of fpickava@earthlink.net Sent: Wednesday, April 06, 2005 10:07 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions.; This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, >=20 > I am going to a client site that does not have SQRW installed. They deve= lop SQR's in text and submit for execution via native Unix (ugly). How do = I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. --=20 ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 13:10:54 2005 From: "Don Duwe" Subject: RE: [sqr-users] SQRW Question (SORT ARRAYS) Date: Wed, 6 Apr 2005 14:10:38 -0400 MAYBE YOU CAN USE THIS SORT. Begin-Procedure SORT-FDVSQ ! SORT FDVSQ LET #ix1 = 0 WHILE #ix1 < 400 GET $F1 #F0 #F1 #F2 #F3 #F4 #F5 #F6 #F7 #F8 #F9 #F10 #F11 FROM FDVSQ(#ix1) FDQ FDD(0) FDD(1) FDD(2) FDD(3) FDD(4) FDD(5) FDD(6) FDD(7) FDD(8) FDD(9) FDD(10) FDD(11) IF $TS1 = '' BREAK END-IF LET $sortkey1 = $TS1 LET #ix2 = #ix1 + 1 WHILE #ix2 < 400 GET $F12 #F02 #F12 #F22 #F32 #F42 #F52 #F62 #F72 #F82 #F92 #F102 #F112 FROM FDVSQ(#ix1) FDQ FDD(0) FDD(1) FDD(2) FDD(3) FDD(4) FDD(5) FDD(6) FDD(7) FDD(8) FDD(9) FDD(10) FDD(11) IF $TS2 = '' BREAK END-IF LET $sortkey2 = $TS2 IF ($sortkey1 >= $sortkey2) PUT $TS2 #S12 INTO FDVSQ(#ix1) FDQ FDD(0) PUT $TS1 #S11 INTO FDVSQ(#ix2) FDQ FDD(0) LET $TS1 = $TS2 LET #F1 = #F12 LET #F2 = #F22 LET #F3 = #F32 LET #F4 = #F42 LET #F5 = #F52 LET #F6 = #F62 LET #F7 = #F72 LET #F8 = #F82 LET #F9 = #F92 LET #F10 = #F102 LET #F11 = #F112 LET $sortkey1 = $TS1 END-IF ADD 1 to #ix2 END-WHILE ADD 1 to #ix1 END-WHILE End-Procedure ! SORT FDVSQ -----Original Message----- From: sqr-users-bounces+dduwe=nookind.com@sqrug.org [mailto:sqr-users-bounces+dduwe=nookind.com@sqrug.org]On Behalf Of Bartlett, Dwain Sent: Wednesday, April 06, 2005 1:17 PM To: This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions. Subject: RE: [sqr-users] SQRW Question The attachment did get sent, so here is the code. !********************************************************************** !* * !* MODULE: TDSORTR.SQR * !* AUTHOR: TONY DELIA. * !* DATE: 03/01/1999. * !* SYSTEM: TD SQR UTILITY SERIES. * !* DESC: SQR RECURSIVE SORT EXPLANATION (QUICKSORT). * !* * !********************************************************************** !* * !* NOTE: THIS SAMPLE EXPANDS ON THE SQR TUTORIAL PROGRAM * !* EX24A.SQR (QUICKSORT SAMPLE CODE). THE QUICKSORT * !* ALGORITHM IS COMMONLY UTILIZED IN C, BASIC, JAVA, * !* ETC. BUT NOT COMMONLY UNDERSTOOD. SOME STRUCTURAL * !* CHANGES HAVE BEEN MADE TO THE QUICKSORT ROUTINE * !* AS FOLLOWS: * !* * !* A) ALLOW MULTIPLE SORT KEYS TO BE USED. * !* * !* EXAMPLE USES STATE AND AREA CODE AS KEYS. * !* * !* B) SENSIBLE POINTER NAMES REPLACING #m, #n, #i, #j. * !* * !* #qlo - LO ARRAY BOUNDARY. * !* #qhi - HI ARRAY BOUNDARY. * !* #qbwd - BACKWARD TRAVERSAL POINTER. * !* #qfwd - FORWARD TRAVERSAL POINTER. * !* * !* C) CHANGED MISLEADING POINTER LIMIT ON BACKWARD * !* TRAVERSAL. EX24A.SQR USES STATEMENT... * !* * !* while #j >= 0 TO CONTROL BACKWARD TRAVERSAL. * !* * !* THIS IMPLIES BACKWARD TRAVERSAL GOES THROUGH THE * !* START OF ARRAY. ACTUALLY THE BACKWARD TRAVERSAL * !* ENDS WHEN IT INTERSECTS WITH FORWARD POINTER. * !* BESIDES WHEN 2ND RECURSIVE SORT IS CALLED WITHIN * !* THE 'PARENT' SORT THE LO BOUNDARY IS NEVER ZERO. * !* * !* D) FURTHER CLARIFIED CODE ON FINAL SWAP. CURRENTLY * !* LO/BWD SWAP IS UNCONDITIONAL. IF ELEMENTS ARE IN * !* THEIR PROPER PLACE THERE'S NO NEED TO SWAP. ALSO * !* STREAMLINED RECURSIVE ARRAY POPULATION A BIT. * !* * !* E) COMMENTS INSERTED TO EXPLAIN FUNCTIONALITY OF * !* PROGRAM. * !* * !********************************************************************** !* * !* OVERVIEW: THE RECURSIVE 'QUICKSORT' PERFORMS SEVERAL TASKS. * !* NOTE THE FIRST ELEMENT IS USED AS THE 'OBJECT' KEY. * !* LO AND HI ARRAY BOUNDARIES ARE PASSED TO THE SORT. * !* * !* THE FIRST STEP USES A FORWARD POINTER TO FIND THE * !* 'NEXT' ELEMENT > OBJECT KEY. THEN STARTING FROM THE * !* HI BOUNDARY A BACKWARD POINTER IS USED TO FIND THE * !* 'NEXT' ELEMENT < OBJECT KEY. THE FWD AND BWD ARRAY * !* ELEMENTS MAY THEN BE SWAPPED. THIS IS BASED ON THE * !* SIMPLE ALGEBRAIC RULE: * !* * !* IF (KEY < FWD) AND (KEY > BWD) THEN (FWD > BWD). * !* * !* ABOVE PROCESS REPEATED UNTIL FWD/BWD POINTERS * !* INTERSECT. ONCE COMPLETE A FINAL SWAP 'MAY' BE * !* REQUIRED BETWEEN THE OBJECT KEY (LO) AND BACKWARD * !* POINTER. AT THIS POINT THE BACKWARD POINTER IS USED * !* AS A TABLE DIVIDER. FOR BOTH SECTIONS THE RECURSIVE * !* SORT IS PERFORMED AGAIN USING THE SECTION LO/HI * !* BOUNDARIES. SINCE SQR DOES NOT SUPPORT RECURSIVE * !* VARIABLES AN ARRAY IS USED TO STORE LO/HI BOUNDARY * !* PARAMETERS FOR THE SECOND HALF OF THE TABLE (THE * !* FIRST SECTION IS CALLED IMMEDIATELY). * !* * !* GRAPHIC: * !* ---------------------------------------------- * !* LEVEL LO FWD-> <-BWD HI * !* #1 0 1 2 3 4 5 6 . . . . n * !* /| * !* --------------------- ---------------------- * !* LEVEL LO FWD-> <-BWD HI LO FWD-> <-BWD HI * !* #2 0 1 2 3 4 5 6 . . . . n * !* /| /| * !* etc. etc. etc. etc. * !* --------- --------- --------- ---------- * !* #3 0 1 2 3 4 5 6 . . . . n * !* * !********************************************************************** !* * !* SEE TDSORTR.ALC FOR IBM/370 ASSEMBLER VERSION OF * !* RECURSIVE SORTING. COMMENTS GIVEN FOR EACH LINE. * !* SAME STATE/AREACODE/DESCRIPTION ARRAY USED IN BOTH * !* ASSEMBLER AND SQR VERSIONS. * !* * !********************************************************************** #include 'setenv.sqc' ! Set environment !********************************************************************** !* Setup Procedure * !********************************************************************** begin-setup #Include 'setup02a.sqc' ! Printer and page-size init landscape #define max_rows 5000 end-setup !********************************************************************** !* Mainline Processing * !********************************************************************** begin-report do Init-DateTime do Get-Current-DateTime move $AsOfToday to $AsOfDate do Process-Main end-report !********************************************************************** !* Set Defaults * !********************************************************************** begin-procedure Set-Defaults let $ReportId = 'TDSORTR' let $ReportTitle = 'SQR Recursive Sort (QuickSort)' display $ReportId noline display ' ' noline display $ReportTitle display ' ' end-procedure !********************************************************************** !* Process Main * !********************************************************************** begin-procedure Process-Main create-array name=Qsort size={max_rows} field=Qlo:number field=Qhi:number create-array name=Qarray size={max_rows} field=Qkey:char field=Qarea:char field=Qdesc:char do Load-Array do QuickSort(0, 0, #Qmax) do Display-Results end-procedure !********************************************************************** !* Recursive Sort * !********************************************************************** begin-procedure QuickSort(#level, #Qlo, #Qhi) if #Qlo < #Qhi let #Qfwd = #Qlo ! Init forward pointer let #Qbwd = #Qhi + 1 ! Init backward pointer ! Lo Boundary is Key Object(s) let $Qkey = Qarray.Qkey (#Qlo) let $Qarea = Qarray.Qarea (#Qlo) while 1 = 1 ! Traverse Forward - find 'next' array.key > Qkey ! Bypass all keys less than Object Key (Qkey) let #Qfwd = #Qfwd + 1 while #Qfwd <= #Qbwd if $Qkey < Qarray.Qkey (#Qfwd) or $Qkey = Qarray.Qkey (#Qfwd) and $Qarea < Qarray.Qarea (#Qfwd) break end-if let #Qfwd = #Qfwd + 1 end-while ! Traverse Backward - find 'next' array.key < Qkey ! Bypass all keys more than Object Key (Qkey) let #Qbwd = #Qbwd - 1 while #Qbwd >= #Qfwd ! Logically #Qfwd is limit if $Qkey > Qarray.Qkey (#Qbwd) or $Qkey = Qarray.Qkey (#Qbwd) and $Qarea > Qarray.Qarea (#Qbwd) break end-if let #Qbwd = #Qbwd - 1 end-while ! Once traversed Boundaries meet exit main loop if #Qfwd >= #Qbwd break end-if ! Swap Forward/Backward Elements do QSortSwap(#Qfwd, #Qbwd) end-while ! Swap Lo Boundary / Backward Elements if $Qkey > Qarray.Qkey (#Qbwd) or $Qkey = Qarray.Qkey (#Qbwd) and $Qarea > Qarray.Qarea (#Qbwd) do QSortSwap(#Qlo, #Qbwd) end-if ! At this point the table is split in two sections. ! Save boundaries of 2nd half (due to non-recursive variables) let #level = #level + 1 let Qsort.Qlo (#level - 1) = #Qbwd + 1 let Qsort.Qhi (#level - 1) = #Qhi ! Now sort from Lo to New Hi let #Qhi = #Qbwd - 1 do QuickSort(#level, #Qlo, #Qhi) ! Now sort from New Lo to Hi (Restoring first) let #Qlo = Qsort.Qlo (#level - 1) let #Qhi = Qsort.Qhi (#level - 1) do QuickSort(#level, #Qlo, #Qhi) let #level = #level - 1 end-if end-procedure !********************************************************************** !* Sort Lo/Hi Array Elements * !********************************************************************** begin-procedure QSortSwap(#lo, #hi) get $Qkey $Qarea $Qdesc from Qarray (#lo) Qkey Qarea Qdesc let Qarray.Qkey (#lo) = Qarray.Qkey (#hi) let Qarray.Qarea (#lo) = Qarray.Qarea (#hi) let Qarray.Qdesc (#lo) = Qarray.Qdesc (#hi) put $Qkey $Qarea $Qdesc into Qarray (#hi) Qkey Qarea Qdesc end-procedure !********************************************************************** !* Load Array * !********************************************************************** begin-procedure Load-Array let #idx = 0 let $Qdata = 'AK907ALASKA' do Load-Element let $Qdata = 'DE302DELAWARE' do Load-Element let $Qdata = 'GA404GEORGIA' do Load-Element let $Qdata = 'GA706GEORGIA' do Load-Element let $Qdata = 'MD301MARYLAND' do Load-Element let $Qdata = 'NJ201NEW JERSEY' do Load-Element let $Qdata = 'WA206WASHINGTON' do Load-Element let $Qdata = 'NY607NEW YORK' do Load-Element let $Qdata = 'NJ908NEW JERSEY' do Load-Element let $Qdata = 'NJ609NEW JERSEY' do Load-Element let $Qdata = 'WA509WASHINGTON' do Load-Element let $Qdata = 'MD410MARYLAND' do Load-Element let $Qdata = 'PA610PENNSYLVANIA' do Load-Element let $Qdata = 'GA912GEORGIA' do Load-Element let $Qdata = 'NY212NEW YORK' do Load-Element let $Qdata = 'PA412PENNSYLVANIA' do Load-Element let $Qdata = 'NY914NEW YORK' do Load-Element let $Qdata = 'PA814PENNSYLVANIA' do Load-Element let $Qdata = 'NY315NEW YORK' do Load-Element let $Qdata = 'NY516NEW YORK' do Load-Element let $Qdata = 'NY716NEW YORK' do Load-Element let $Qdata = 'NY917NEW YORK' do Load-Element let $Qdata = 'NY917MANHATTEN' do Load-Element let $Qdata = 'PA215PENNSYLVANIA' do Load-Element let $Qdata = 'PA717PENNSYLVANIA' do Load-Element let $Qdata = 'NY518NEW YORK' do Load-Element let $Qdata = 'NY718NEW YORK' do Load-Element let $Qdata = 'PA724PENNSYLVANIA' do Load-Element let $Qdata = 'NJ732NEW JERSEY' do Load-Element let $Qdata = 'MD240MARYLAND' do Load-Element let $Qdata = 'MD443MARYLAND' do Load-Element let $Qdata = 'WA360WASHINGTON' do Load-Element let $Qdata = 'GA770GEORGIA' do Load-Element let $Qdata = 'NJ973NEW JERSEY' do Load-Element let $Qdata = 'GA678GEORGIA' do Load-Element let #Qmax = #idx - 1 end-procedure !********************************************************************** !* Load Element * !********************************************************************** begin-procedure Load-Element let Qarray.Qkey (#idx) = substr($Qdata,1,2) let Qarray.Qarea (#idx) = substr($Qdata,3,3) let Qarray.Qdesc (#idx) = rtrim(substr($Qdata,6,20),' ') let #idx = #idx + 1 end-procedure !********************************************************************** !* Display Results * !********************************************************************** begin-procedure Display-Results display ' ' display 'Sorted Results' display ' ' display 'State Area Description' display '----- ---- --------------------' display ' ' let #idx = 0 while #idx <= #Qmax let $Qkey = Qarray.Qkey (#idx) let $Qarea = Qarray.Qarea (#idx) let $Qdesc = Qarray.Qdesc (#idx) let $Qdata = rpad($Qkey,7,' ') || rpad($Qarea,6,' ') || $Qdesc display $Qdata let #idx = #idx + 1 end-while display ' ' end-procedure !********************************************************************** !* Include Members: * !********************************************************************** #Include 'curdttim.sqc' !Get-Current-DateTime procedure #Include 'datetime.sqc' !Routines for date and time formatting !Init-DateTime procedure Dwain Bartlett SABHRS Services Bureau, ITSD HR Systems Analyst (406) 444-0418 dbartlett@mt.gov -----Original Message----- From: sqr-users-bounces+dbartlett=mt.gov@sqrug.org [mailto:sqr-users-bounces+dbartlett=mt.gov@sqrug.org]On Behalf Of fpickava@earthlink.net Sent: Wednesday, April 06, 2005 10:07 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions.; This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, > > I am going to a client site that does not have SQRW installed. They develop SQR's in text and submit for execution via native Unix (ugly). How do I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ********************************************************************* Note: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. ********************************************************************* _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 14:07:18 2005 Subject: RE: [sqr-users] Dynamic database links Date: Wed, 6 Apr 2005 15:06:36 -0400 From: "Debbie Larney" Thanks for the advice. I did just as you suggested and it worked like a cha= rm. -----Original Message----- From: Alexander, Steve [mailto:Steven.Alexander@sanjoseca.gov] Sent: Tuesday, April 05, 2005 7:25 PM To: 'This list is for discussion about the SQR database reportinglanguagefrom Hyperion Solutions.' Subject: RE: [sqr-users] Dynamic database links In Oracle, tables that are accessed via a database link are written in the form "payruleids@kdev". It may be different in other databases, but I suspect you cannot have a space between the table name and the database instance name. Also, the SQR compiler wants to validate your fields, so it needs to know a table with the same layout as your dynamically selected table. You might write the FROM clause as: from [$table_at_db : payruleids@kdev] a That tells SQR to use the copy of payruleids in the kdev database instance to determine whether your fields are valid and what type they are. If you are not always connected to kdev (or any instance that includes payruleids), you can identify the type of each field - but I forget the syntax. -----Original Message----- From: Bob Stone [mailto:bstone@fastenal.com] Sent: Tuesday, April 05, 2005 2:55 PM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] Dynamic database links I've got 2 different ideas for you. First, maybe try letting $dblink default to something you know will work before all the if statements (it's def on KDEV so 'let $dblink =3D 'KDEV' ' and then change it once you know what $kronos_db is). That way it compiles knowing that $dblink will have a value. As is, it looks like all the ifs could fail, and then $dblink has no value/doesn't exist. I'm speaking in terms of possibility...even though you may NEVER have a value other than those 4, there is no 'else !other ' statement that ensures the compiler that $dblink is set in one of those checks. Second, now I've never tried this, but maybe you could make the entire from clause dynamically. That way it will have to parse it at run time instead of compile time? maybe? (i could be wrong on this...dynamic from clauses isn't something I've tried). Just a suggestion...something to try.=20=20 let $from_clause =3D 'FROM payruleids ' || $dblink || ' a' begin-select loops=3D1 a.name=20=20 Let $found_new_bu =3D 'Y' [$from_clause] where ... end-select -----Original Message----- From: sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org]On Behalf Of Debbie Larney Sent: Tuesday, April 05, 2005 4:40 PM To: sqr-users@sqrug.org Subject: [sqr-users] Dynamic database links Hello Everyone, I was wondering if it was possible to dynamically define database links in sqr. I am trying to access a vendor's database via a database link. I know that the database link is set up properly because if I hardcode the link name in my sql statement I am able to run my program to success. The problem I have is that I want to define this value dynamically based on run control parameters. I get compile errrors when I try this dynamically because the database link variable name is not determined until after the program compiles. I presume I could define the tables in the database that I am executing my program from but I really don't want to have to do that. Anyone have any great ideas. Snippets of my code and the errors from the log file are listed below. Thanks in advance for any assistance --Definition of the database link if $kronos_db =3D 'KPRD' let $dblink =3D {dblink_kprd}--This is defined gloablly else if $kronos_db =3D 'KTST' let $dblink =3D {dblink_ktst}--This is defined gloablly else if $kronos_db =3D 'KDEV' let $dblink =3D {dblink_kdev}--This is defined gloablly else if $kronos_db =3D 'KSYS' let $dblink =3D {dblink_ksys}--This is defined gloablly =20 end-if end-if end-if end-if=20 --One of the procedures with a compile error !--------------------------------------------------------------------------- --! ! Procedure : Check-New-BU ! Called From: Get-RC-Params ! Description: Checks to see if payrules already exist for the selected=20 ! clone to bu !--------------------------------------------------------------------------- --! begin-procedure Check-New-BU move 'Check-New-BU' to $operation_name #ifdef debugf show 'Procedure: ' $operation_name #end-if let $found_new_bu =3D 'N' begin-select loops=3D1 a.name=20=20 Let $found_new_bu =3D 'Y' show 'Error: new BU payrules already exist =3D ' $new_bu from payruleids [$dblink] a=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 where substr(a.name,1,5) =3D $new_bu=20 End-Select end-procedure Check-New-BU error below notice that the dblink is not defined at compile time and not part of the sql SQR 5528) ORACLE OCIStmtExecute error 942 in cursor 32:=20 ORA-00942: table or view does not exist=20 SQL: SELECT a.name from payruleids=20 Error on line 260: (SQR 3716) Error in SQL statement.=20 ********************************************************************=20 CONFIDENTIALITY NOTICE:=20 The information contained in this e-mail is legally privileged and confidential information intended only for the use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient, you are hereby notified that any viewing, dissemination, distribution, or copying of this e-mail message is strictly prohibited. If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete this e-mail from your system. Thank you.=20 ********************************************************************=20 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 06 14:19:24 2005 Date: Wed, 6 Apr 2005 12:18:40 -0700 (PDT) From: "fpickava@earthlink.net" Subject: RE: [sqr-users] SQRW Question Thank you....Frank -----Original Message----- From: "Bartlett, Dwain" Sent: Apr 6, 2005 10:11 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: RE: [sqr-users] SQRW Question Attached is code for sorting an array. Dwain Bartlett SABHRS Services Bureau, ITSD HR Systems Analyst (406) 444-0418 dbartlett@mt.gov -----Original Message----- From: sqr-users-bounces+dbartlett=mt.gov@sqrug.org [mailto:sqr-users-bounces+dbartlett=mt.gov@sqrug.org]On Behalf Of fpickava@earthlink.net Sent: Wednesday, April 06, 2005 10:07 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions.; This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: Re: [sqr-users] SQRW Question Is there some way an Array can be sorted? Thanks -----Original Message----- From: Robert Goshko Sent: Feb 25, 2005 6:52 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: Re: [sqr-users] SQRW Question On Fri, 25 Feb 2005 07:47:01 -0500 (GMT-05:00), fpickava@earthlink.net wrote: > To All, > > I am going to a client site that does not have SQRW installed. They develop SQR's in text and submit for execution via native Unix (ugly). How do I go abount obtaining the SQRW software and documentation? SQR programs are always text files, unless compiled to an SQT. If they do not own an SQRW license, then you would have to get one. I usually run SQR from the command line in UNIX, if you think that is ugly, try running SQR on MVS. -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 1 GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 07 12:50:10 2005 Date: Thu, 7 Apr 2005 10:51:24 -0700 From: "Nanci Lawson" Subject: [sqr-users] Simple text file Hello, I am a novice to sqr and have written a fairly simple one to extract a text file. The problem I am having is that there is a space between my heading and the first line of data and I really don't have a good way of knowing how many lines of data I will end up with. Thus the use of max-lines. I would appreciate any help with refinement. Thanks, Nanci=20 !*********************************************************************** ! SALLIE_MAE - produces file for payment plan !*********************************************************************** !*********************************************************************** !*********************************************************************** ! * ! $Release: * ! $Revision: 2 * ! $Version-ID: * ! NOTES: need to change the record count down in the trailer each * ! time and to make sure the max_lines are set to include all * ! in the first pass * ! * !*********************************************************************** #Include 'SETENV1.SQC' !#Include 'curdttim.sqc' !Get-Current-DateTime procedure #Include 'datetime.sqc' !Routines for date and time formatting Begin-Setup =20=20 Declare-Layout Default =20 Line-width=3D320 Left-margin=3D0 Top-margin=3D0 Formfeed=3DNO Max-lines=3D401 =20 End-Declare End-Setup begin-report ! do Get-Current-DateTime=20=20 do Process-Main begin-SELECT {DateTimeOut-Prefix}GETDATE(){DateTimeOut-Suffix} &_SysDateTime FROM PSCLOCK end-SELECT let $tempDate =3D datetostr(&_SysDateTime,'YYYYMMDDHHMISS') =20=20 end-report #define C1 1 #define C2 96 #define C3 61 #define C4 313 #define C5 45 begin-heading 1 Let $space =3D '*' Let $header =3D 'HR002101500000899984002101500'||$tempDate||RPAD('PIL',276,' ')||$space =20 print $header (0,1) =20=20=20=20 =20=20=20 end-heading=20 !*********************************************************************** ! PROC PROCESS-MAIN ! Main Procedure !*********************************************************************** BEGIN-PROCEDURE Process-Main BEGIN-SELECT=20 '01' (+1,{C1}) B.FIRST_NAME_SRCH (0,{C2})=20=20=20 B.LAST_NAME_SRCH (0,{C3})=20=20 B.BIRTHDATE (0,{C4}) edit YYYYMMDD =20=20=20 B.EMPLID (0,{C5}) FROM PS_ACAD_PROG A, PS_PERS_DATA_SA_VW B WHERE A.EFFDT =3D=20 (SELECT MAX(A_ED.EFFDT) FROM PS_ACAD_PROG A_ED=20 WHERE A.EMPLID =3D A_ED.EMPLID=20 AND A.ACAD_CAREER =3D A_ED.ACAD_CAREER=20 AND A.STDNT_CAR_NBR =3D A_ED.STDNT_CAR_NBR=20 AND A_ED.EFFDT <=3D SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10))=20 AND A.EFFSEQ =3D=20 (SELECT MAX(A_ES.EFFSEQ) FROM PS_ACAD_PROG A_ES=20 WHERE A.EMPLID =3D A_ES.EMPLID=20 AND A.ACAD_CAREER =3D A_ES.ACAD_CAREER=20 AND A.STDNT_CAR_NBR =3D A_ES.STDNT_CAR_NBR=20 AND A.EFFDT =3D A_ES.EFFDT)=20 AND A.EMPLID =3D B.EMPLID=20 AND A.PROG_STATUS =3D 'AC' END-SELECT END-PROCEDURE begin-footing 1 Let $space =3D '*'=20=20 Let $footer =3D RPAD('TR003790000020030424185700',319,' ')||$space =20 print $footer (0,1) =20=20=20=20 end-footing=20 Nanci Lawson ANGEL Administrator PeopleSoft Programmer/Analyst Soka University=20 949-480-4222 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 07 13:00:45 2005 Date: Thu, 7 Apr 2005 11:59:39 -0600 From: Robert Goshko Subject: Re: [sqr-users] Simple text file On Apr 7, 2005 11:51 AM, Nanci Lawson wrote: > Hello, > > I am a novice to sqr and have written a fairly simple one to extract a > text file. The problem I am having is that there is a space between my > heading and the first line of data and I really don't have a good way of > knowing how many lines of data I will end up with. Thus the use of > max-lines. I would appreciate any help with refinement. Welcome Nanci, For something like this you would be better off using the OPEN / WRITE / CLOSE commands in SQR as these handle writing to flat files petter, when you use the print functions you are subject to the rules defined by a layout, print is mainly used in the creation of reports that you would like formatted for printing out. -- ...Rob -- No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced. ==================================================================== Robert Goshko Registered Linux User #260513 Want a Gmail account, 2+ GB web mail, just ask me. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 07 13:47:36 2005 Date: Thu, 7 Apr 2005 11:46:31 -0700 (PDT) From: Dattatraya Shetty Subject: Re: [sqr-users] Simple text file Hi Nanci, Looks like you want to create a fixed with File after reading from a Table. Most simple thing to do is open file for output Begin-select columns write 1 from $str --- Nanci Lawson wrote: > Hello, > > I am a novice to sqr and have written a fairly simple one to extract > a > text file. The problem I am having is that there is a space between > my > heading and the first line of data and I really don't have a good way > of > knowing how many lines of data I will end up with. Thus the use of > max-lines. I would appreciate any help with refinement. > Thanks, > Nanci > > > !*********************************************************************** > ! SALLIE_MAE - produces file for payment plan > !*********************************************************************** > !*********************************************************************** > !*********************************************************************** > ! > * > ! $Release: > * > ! $Revision: 2 > * > ! $Version-ID: > * > ! NOTES: need to change the record count down in the trailer each > * > ! time and to make sure the max_lines are set to include all > * > ! in the first pass > * > ! > * > !*********************************************************************** > > #Include 'SETENV1.SQC' > !#Include 'curdttim.sqc' !Get-Current-DateTime procedure > #Include 'datetime.sqc' !Routines for date and time formatting > > > > > Begin-Setup > > > Declare-Layout Default > > Line-width=320 > Left-margin=0 > Top-margin=0 > Formfeed=NO > Max-lines=401 > > End-Declare > > > End-Setup > > > begin-report > ! do Get-Current-DateTime > do Process-Main > > > begin-SELECT > {DateTimeOut-Prefix}GETDATE(){DateTimeOut-Suffix} &_SysDateTime > FROM PSCLOCK > end-SELECT > let $tempDate = datetostr(&_SysDateTime,'YYYYMMDDHHMISS') > > > end-report > > > #define C1 1 > #define C2 96 > #define C3 61 > #define C4 313 > #define C5 45 > > > begin-heading 1 > Let $space = '*' > Let $header = > 'HR002101500000899984002101500'||$tempDate||RPAD('PIL',276,' > ')||$space > > print $header (0,1) > > > end-heading > > !*********************************************************************** > ! PROC PROCESS-MAIN > ! Main Procedure > !*********************************************************************** > > BEGIN-PROCEDURE Process-Main > BEGIN-SELECT > '01' (+1,{C1}) > B.FIRST_NAME_SRCH (0,{C2}) > B.LAST_NAME_SRCH (0,{C3}) > B.BIRTHDATE (0,{C4}) edit YYYYMMDD > > B.EMPLID (0,{C5}) > FROM PS_ACAD_PROG A, PS_PERS_DATA_SA_VW B > WHERE A.EFFDT = > (SELECT MAX(A_ED.EFFDT) FROM PS_ACAD_PROG A_ED > WHERE A.EMPLID = A_ED.EMPLID > AND A.ACAD_CAREER = A_ED.ACAD_CAREER > AND A.STDNT_CAR_NBR = A_ED.STDNT_CAR_NBR > AND A_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10)) > AND A.EFFSEQ = > (SELECT MAX(A_ES.EFFSEQ) FROM PS_ACAD_PROG A_ES > WHERE A.EMPLID = A_ES.EMPLID > AND A.ACAD_CAREER = A_ES.ACAD_CAREER > AND A.STDNT_CAR_NBR = A_ES.STDNT_CAR_NBR > AND A.EFFDT = A_ES.EFFDT) > AND A.EMPLID = B.EMPLID > AND A.PROG_STATUS = 'AC' > > END-SELECT > END-PROCEDURE > > begin-footing 1 > Let $space = '*' > Let $footer = RPAD('TR003790000020030424185700',319,' ')||$space > > > print $footer (0,1) > > end-footing > > > > > > Nanci Lawson > ANGEL Administrator > PeopleSoft Programmer/Analyst > Soka University > 949-480-4222 > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 07 13:51:14 2005 Date: Thu, 7 Apr 2005 11:50:05 -0700 (PDT) From: Dattatraya Shetty Subject: Re: [sqr-users] Simple text file Sorry about the prevoius message folks. Hit send by accident. Nanci, Here is what you need open file write $head begin-select column1 column2 ... let $col1 = &column1 let $col2 = &column2 ... write 1 from $col: $col2: ... from Table write $Tail Close 1 HTH Datta. --- Nanci Lawson wrote: > Hello, > > I am a novice to sqr and have written a fairly simple one to extract > a > text file. The problem I am having is that there is a space between > my > heading and the first line of data and I really don't have a good way > of > knowing how many lines of data I will end up with. Thus the use of > max-lines. I would appreciate any help with refinement. > Thanks, > Nanci > > > !*********************************************************************** > ! SALLIE_MAE - produces file for payment plan > !*********************************************************************** > !*********************************************************************** > !*********************************************************************** > ! > * > ! $Release: > * > ! $Revision: 2 > * > ! $Version-ID: > * > ! NOTES: need to change the record count down in the trailer each > * > ! time and to make sure the max_lines are set to include all > * > ! in the first pass > * > ! > * > !*********************************************************************** > > #Include 'SETENV1.SQC' > !#Include 'curdttim.sqc' !Get-Current-DateTime procedure > #Include 'datetime.sqc' !Routines for date and time formatting > > > > > Begin-Setup > > > Declare-Layout Default > > Line-width=320 > Left-margin=0 > Top-margin=0 > Formfeed=NO > Max-lines=401 > > End-Declare > > > End-Setup > > > begin-report > ! do Get-Current-DateTime > do Process-Main > > > begin-SELECT > {DateTimeOut-Prefix}GETDATE(){DateTimeOut-Suffix} &_SysDateTime > FROM PSCLOCK > end-SELECT > let $tempDate = datetostr(&_SysDateTime,'YYYYMMDDHHMISS') > > > end-report > > > #define C1 1 > #define C2 96 > #define C3 61 > #define C4 313 > #define C5 45 > > > begin-heading 1 > Let $space = '*' > Let $header = > 'HR002101500000899984002101500'||$tempDate||RPAD('PIL',276,' > ')||$space > > print $header (0,1) > > > end-heading > > !*********************************************************************** > ! PROC PROCESS-MAIN > ! Main Procedure > !*********************************************************************** > > BEGIN-PROCEDURE Process-Main > BEGIN-SELECT > '01' (+1,{C1}) > B.FIRST_NAME_SRCH (0,{C2}) > B.LAST_NAME_SRCH (0,{C3}) > B.BIRTHDATE (0,{C4}) edit YYYYMMDD > > B.EMPLID (0,{C5}) > FROM PS_ACAD_PROG A, PS_PERS_DATA_SA_VW B > WHERE A.EFFDT = > (SELECT MAX(A_ED.EFFDT) FROM PS_ACAD_PROG A_ED > WHERE A.EMPLID = A_ED.EMPLID > AND A.ACAD_CAREER = A_ED.ACAD_CAREER > AND A.STDNT_CAR_NBR = A_ED.STDNT_CAR_NBR > AND A_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10)) > AND A.EFFSEQ = > (SELECT MAX(A_ES.EFFSEQ) FROM PS_ACAD_PROG A_ES > WHERE A.EMPLID = A_ES.EMPLID > AND A.ACAD_CAREER = A_ES.ACAD_CAREER > AND A.STDNT_CAR_NBR = A_ES.STDNT_CAR_NBR > AND A.EFFDT = A_ES.EFFDT) > AND A.EMPLID = B.EMPLID > AND A.PROG_STATUS = 'AC' > > END-SELECT > END-PROCEDURE > > begin-footing 1 > Let $space = '*' > Let $footer = RPAD('TR003790000020030424185700',319,' ')||$space > > > print $footer (0,1) > > end-footing > > > > > > Nanci Lawson > ANGEL Administrator > PeopleSoft Programmer/Analyst > Soka University > 949-480-4222 > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun Apr 10 11:40:59 2005 From: "radhika reddy" Date: Sun, 10 Apr 2005 11:39:56 -0500 Subject: [sqr-users] Flat File Hi, I am reading a flat file and inserting into tables(Inbound interface). I am having a problem reading it, when i reach end of file it is still looking for data and taking it as empty record. The program is working good except that the number of errors is added by 1 though it's not. I use While loop for looping through the flat file and also i am checking end of file condition too. Is this the bad flat file or am I missing something? Thanks. Any input would be appreciated. _________________________________________________________________ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun Apr 10 12:47:38 2005 Date: Sun, 10 Apr 2005 13:46:31 -0400 From: "Larry Roux" Subject: Re: [sqr-users] Flat File Can't you just check for the existence of data? ie if (RTRIM($inputline,' ') <> '' add 1 to #count do insert-line end-if Larry Roux Syracuse University lroux@syr.edu >>> radhika_05@hotmail.com 04/10/05 12:39 PM >>> Hi, I am reading a flat file and inserting into tables(Inbound interface). I am having a problem reading it, when i reach end of file it is still looking for data and taking it as empty record. The program is working good except that the number of errors is added by 1 though it's not. I use While loop for looping through the flat file and also i am checking end of file condition too. Is this the bad flat file or am I missing something? Thanks. Any input would be appreciated. _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun Apr 10 18:11:00 2005 From: "Prasanna Menta" Date: Sun, 10 Apr 2005 19:09:57 -0400 Subject: Re: [sqr-users] Flat File Post the code and will be able to debug the issue. Prasana ----- Original Message ----- From: "radhika reddy" Date: Sunday, April 10, 2005 12:39 pm Subject: [sqr-users] Flat File > Hi, >=20 > I am reading a flat file and inserting into tables(Inbound=20 > interface). I=20 > am having a problem reading it, > when i reach end of file it is still looking for data and taking=20 > it as empty=20 > record. The program is working good except that the number of=20 > errors is=20 > added by 1 though it's not. >=20 > I use While loop for looping through the flat file and also i am=20 > checking=20 > end of file condition too. Is this the bad flat file or am I=20 > missing=20 > something? >=20 > Thanks. Any input would be appreciated. >=20 > _________________________________________________________________ > Don=92t just search. Find. Check out the new MSN Search!=20 > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ >=20 >=20 > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 11 08:16:40 2005 Subject: RE: [sqr-users] Flat File Date: Mon, 11 Apr 2005 09:15:52 -0400 From: "Kaithi, Murali" Hi Radhika, I am hoping its bad text file. I experienced this kind of problem before. Check your text file thoroughly. Murali.=20 -----Original Message----- From: sqr-users-bounces+murali.kaithi=3Dspencergifts.com@sqrug.org [mailto:sqr-users-bounces+murali.kaithi=3Dspencergifts.com@sqrug.org] On Behalf Of radhika reddy Sent: Sunday, April 10, 2005 12:40 PM To: sqr-users@sqrug.org Subject: [sqr-users] Flat File Hi, I am reading a flat file and inserting into tables(Inbound interface). I am having a problem reading it, when i reach end of file it is still looking for data and taking it as empty record. The program is working good except that the number of errors is added by 1 though it's not. I use While loop for looping through the flat file and also i am checking end of file condition too. Is this the bad flat file or am I missing something? Thanks. Any input would be appreciated. _________________________________________________________________ Don't just search. Find. Check out the new MSN Search!=20 http://search.msn.click-url.com/go/onm00200636ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 11 09:08:22 2005 From: "radhika reddy" Subject: RE: [sqr-users] Flat File Date: Mon, 11 Apr 2005 09:07:18 -0500 Murali, You are right. It's bad flat file. It has extra line with no data. Thanks to everybody. Radhika >From: "Kaithi, Murali" >Reply-To: "This list is for discussion about the SQR database >reportinglanguage from Hyperion Solutions." >To: "This list is for discussion about the SQR database reportinglanguage >fromHyperion Solutions." >Subject: RE: [sqr-users] Flat File >Date: Mon, 11 Apr 2005 09:15:52 -0400 > >Hi Radhika, >I am hoping its bad text file. I experienced this kind of problem >before. >Check your text file thoroughly. > >Murali. > >-----Original Message----- >From: sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org >[mailto:sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org] On >Behalf Of radhika reddy >Sent: Sunday, April 10, 2005 12:40 PM >To: sqr-users@sqrug.org >Subject: [sqr-users] Flat File > >Hi, > > I am reading a flat file and inserting into tables(Inbound >interface). I am having a problem reading it, when i reach end of file >it is still looking for data and taking it as empty record. The program >is working good except that the number of errors is added by 1 though >it's not. > >I use While loop for looping through the flat file and also i am >checking end of file condition too. Is this the bad flat file or am I >missing something? > >Thanks. Any input would be appreciated. > >_________________________________________________________________ >Don't just search. Find. Check out the new MSN Search! >http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users > >______________________________________________________________________ >This email has been scanned by the MessageLabs Email Security System. >For more information please visit http://www.messagelabs.com/email >______________________________________________________________________ > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 11 20:27:51 2005 Date: Mon, 11 Apr 2005 19:27:17 -0600 From: marc pechaitis Subject: [sqr-users] blank line being inserted unexpectedly while issuing print commands Hello All - You've been super helpful to me in the past, and I've got another problem that has me stumped. I am writing a report that selects a row of data from a table and based on the data in that row, it may decide to omit the line from the report. So let's say I have table: row 1 - a1 row 2 - a2 row 3 - a3 row 4 - b1 row 5 - b2 row 6 - b3 row 7 - c1 row 8 - c2 row 9 - c3 And I know that, based on the content of row 5 (b2) that I want to omit rows 4-6 (the b's). I've got the logic working so that all three rows are omiitted, but for some reason the output is: a1 a2 a3 c1 c2 c3 and not: a1 a2 a3 c1 c2 c3 I'm just using a basic "print $var (+1,1)" command and have been through the code about a million times to see if I might have an extra "print" statement in my exclusion processing, but I can't find anything. Has anyone encountered anything like this? Any suggestions of things to check that could cause this? Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 11 20:42:13 2005 Date: Mon, 11 Apr 2005 21:41:21 -0400 From: "Larry Roux" Subject: Re: [sqr-users] blank line being inserted unexpectedly while issuingprint commands It appears that you are still printing a line in your loop, but the variable is coming out a space so you don't see the results. As a method of debugging try something like Let $var = $var || ' row: ' || some data from the row that might tell you which row is still printing. also, instead of blanking out the variable (Let $var = ' ') try putting something in there to see if that is, in fact, what is happening. Larry Roux Syracuse University lroux@syr.edu >>> fromthehills@gmail.com 04/11/05 9:27 PM >>> Hello All - You've been super helpful to me in the past, and I've got another problem that has me stumped. I am writing a report that selects a row of data from a table and based on the data in that row, it may decide to omit the line from the report. So let's say I have table: row 1 - a1 row 2 - a2 row 3 - a3 row 4 - b1 row 5 - b2 row 6 - b3 row 7 - c1 row 8 - c2 row 9 - c3 And I know that, based on the content of row 5 (b2) that I want to omit rows 4-6 (the b's). I've got the logic working so that all three rows are omiitted, but for some reason the output is: a1 a2 a3 c1 c2 c3 and not: a1 a2 a3 c1 c2 c3 I'm just using a basic "print $var (+1,1)" command and have been through the code about a million times to see if I might have an extra "print" statement in my exclusion processing, but I can't find anything. Has anyone encountered anything like this? Any suggestions of things to check that could cause this? Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 12 04:06:08 2005 Date: Tue, 12 Apr 2005 09:04:47 +0000 From: marc.taquoi@bluewin.ch Subject: =?ISO-8859-1?Q?Re=3A=20=5Bsqr=2Dusers=5D=20blank=20line=20being=20inserted=20unexpectedly=20while=09issuingprint=20commands?= >-- Message original -- >Date: Mon, 11 Apr 2005 21:41:21 -0400 >From: "Larry Roux" >To: >Subject: Re: [sqr-users] blank line being inserted unexpectedly while > issuingprint commands >Reply-To: "This list is for discussion about the SQR database reporting > language from Hyperion Solutions." > > >It appears that you are still printing a line in your loop, but the >variable is coming out a space so you don't see the results. As a >method of debugging try something like > >Let $var = $var || ' row: ' || some data from the row > >that might tell you which row is still printing. > >also, instead of blanking out the variable (Let $var = ' ') try putting >something in there to see if that is, in fact, what is happening. > > > > > >Larry Roux >Syracuse University >lroux@syr.edu > >>>> fromthehills@gmail.com 04/11/05 9:27 PM >>> >Hello All - >You've been super helpful to me in the past, and I've got another >problem that has me stumped. > >I am writing a report that selects a row of data from a table and >based on the data in that row, it may decide to omit the line from the >report. > >So let's say I have table: >row 1 - a1 >row 2 - a2 >row 3 - a3 >row 4 - b1 >row 5 - b2 >row 6 - b3 >row 7 - c1 >row 8 - c2 >row 9 - c3 > >And I know that, based on the content of row 5 (b2) that I want to >omit rows 4-6 (the b's). I've got the logic working so that all three >rows are omiitted, but for some reason the output is: > >a1 >a2 >a3 > >c1 >c2 >c3 > >and not: >a1 >a2 >a3 >c1 >c2 >c3 > >I'm just using a basic "print $var (+1,1)" command and have been >through the code about a million times to see if I might have an extra >"print" statement in my exclusion processing, but I can't find >anything. > >Has anyone encountered anything like this? Any suggestions of things >to check that could cause this? > >Thanks! >Marc > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users > > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users Marc TAQUOI Chemin des Vignes 1127 CLARMONT Fixe : +41 (0)21 624 21 27 Mobile : +41 (0)79 818 52 35 Email : marc.taquoi@bluewin.ch _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 12 05:11:48 2005 From: "Steve Cavill" Subject: RE: [sqr-users] blank line being inserted unexpectedly while issuingprint commands Date: Tue, 12 Apr 2005 20:10:12 +1000 Do you have a next-listing or position() command, they also cause line feeds. Steve -----Original Message----- From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org [mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] On Behalf Of marc pechaitis Sent: Tuesday, 12 April 2005 11:27 AM To: sqr-users@sqrug.org Subject: [sqr-users] blank line being inserted unexpectedly while issuingprint commands Hello All - You've been super helpful to me in the past, and I've got another problem that has me stumped. I am writing a report that selects a row of data from a table and based on the data in that row, it may decide to omit the line from the report. So let's say I have table: row 1 - a1 row 2 - a2 row 3 - a3 row 4 - b1 row 5 - b2 row 6 - b3 row 7 - c1 row 8 - c2 row 9 - c3 And I know that, based on the content of row 5 (b2) that I want to omit rows 4-6 (the b's). I've got the logic working so that all three rows are omiitted, but for some reason the output is: a1 a2 a3 c1 c2 c3 and not: a1 a2 a3 c1 c2 c3 I'm just using a basic "print $var (+1,1)" command and have been through the code about a million times to see if I might have an extra "print" statement in my exclusion processing, but I can't find anything. Has anyone encountered anything like this? Any suggestions of things to check that could cause this? Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 12 08:41:00 2005 Date: Tue, 12 Apr 2005 07:40:23 -0600 From: marc pechaitis Subject: Re: [sqr-users] blank line being inserted unexpectedly while issuingprint commands Steve, This is what I am using for the processing of the report: @#@#@#@#@#@#@#@#@#@#@#start begin-procedure Get-Transcript-Info Columns 1 90 Let #bottom-line = 56 begin-Select A.REPORT_REQUEST_NBR, A.REQUEST_SEQ_NBR, C.TSCRPT_TYPE, A.REPORT_NUMBER, B.COPY_NUMBER, A.REPORT_LINE_NBR, A.TSCRPT_COMP_CODE, A.TSCRPT_COMP_DATA, A.DISPLAY_ATTR, B.TSCRPT_TITLE, B.TSCRPT_INS_ADDR1, B.TSCRPT_INS_ADDR2, B.TSCRPT_INS_ADDR3, B.TSCRPT_INS_ADDR4, B.TSCRPT_INS_ADDR5, B.TSCRPT_INS_ADDR6, B.TSCRPT_INS_ADDR7, B.TSCRPT_EM_ADDR1, B.TSCRPT_EM_ADDR2, B.TSCRPT_EM_ADDR3, B.TSCRPT_EM_ADDR4, B.TSCRPT_EM_ADDR5, B.TSCRPT_EM_ADDR6, B.TSCRPT_EM_ADDR7, B.TSCRPT_EM_ADDR8, B.TSCRPT_EM_ADDR9, B.TSCRPT_EM_ADDR10, B.TSCRPT_EM_ADDR11, Let $DisplayAttr = Rtrim(&A.DISPLAY_ATTR,' ') Let $TranscriptLine = Rtrim(&A.TSCRPT_COMP_DATA,' ') Let $TranscriptType = Rtrim(&C.TSCRPT_TYPE, ' ') Let $TrimmedTransLine = Ltrim($TranscriptLine, ' ') Let $OtherLine = 'Y' if #current-line >= #bottom-line Next-Column Goto-Top=1 At-End=NewPage Let $Subject = substr($TranscriptLine, 1, 8) Let $CatalogNbr = substr($TranscriptLine, 11, 10) Evaluate $TranscriptType When = 'OFFIC' do Proc-Transcript-Line-OFFIC break When = 'OFFEX' do Proc-Transcript-Line-OFFEX break When-Other if ($DisplayAttr = 'B') print $TranscriptLine (+1,1) bold else print $TranscriptLine (+1,1) end-if end-evaluate else Let $Subject = substr($TranscriptLine, 1, 8) Let $CatalogNbr = substr($TranscriptLine, 11, 10) Evaluate $TranscriptType When = 'OFFIC' do Proc-Transcript-Line-OFFIC break When = 'OFFEX' do Proc-Transcript-Line-OFFEX break When-Other if ($DisplayAttr = 'B') print $TranscriptLine (+1,1) bold else print $TranscriptLine (+1,1) end-if end-evaluate end-if FROM PS_SA_REPORT_RSLT A, PS_SA_RPT_RSLT_HDR B, PS_SA_REQUEST_HDR C WHERE A.REPORT_REQUEST_NBR = $ReptReqstID AND A.REQUEST_SEQ_NBR = $ReptReqstSeq AND A.REPORT_REQUEST_NBR = B.REPORT_REQUEST_NBR AND A.REPORT_REQUEST_NBR = $ReptReqstID AND A.REPORT_REQUEST_NBR = C.REPORT_REQUEST_NBR AND A.REQUEST_SEQ_NBR = B.REQUEST_SEQ_NBR AND A.REPORT_NUMBER = B.REPORT_NUMBER AND A.TSCRPT_COMP_CODE NOT LIKE 'T0%' AND A.TSCRPT_COMP_CODE NOT LIKE 'IN%' AND A.TSCRPT_COMP_CODE NOT LIKE 'EM%' ORDER BY 1, 2, 3, 5 end-Select end-procedure !Get-Transcript-Info @#@#@#@#@#@#@#@#@#@#@#end And I suspect that the lines: if #current-line >= #bottom-line Next-Column Goto-Top=1 At-End=NewPage are the ones that could be issuing the line extra line feeds...is this possible? Is there any way to supress this? (I have included these lines to print the report two columns of one "page" to a landscape sheet). Thanks, Marc On Apr 12, 2005 4:10 AM, Steve Cavill wrote: > Do you have a next-listing or position() command, they also cause line > feeds. > Steve > > -----Original Message----- > From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org > [mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] On > Behalf Of marc pechaitis > Sent: Tuesday, 12 April 2005 11:27 AM > To: sqr-users@sqrug.org > Subject: [sqr-users] blank line being inserted unexpectedly while > issuingprint commands > > Hello All - > You've been super helpful to me in the past, and I've got another problem > that has me stumped. > > I am writing a report that selects a row of data from a table and based on > the data in that row, it may decide to omit the line from the report. > > So let's say I have table: > row 1 - a1 > row 2 - a2 > row 3 - a3 > row 4 - b1 > row 5 - b2 > row 6 - b3 > row 7 - c1 > row 8 - c2 > row 9 - c3 > > And I know that, based on the content of row 5 (b2) that I want to omit rows > 4-6 (the b's). I've got the logic working so that all three rows are > omiitted, but for some reason the output is: > > a1 > a2 > a3 > > c1 > c2 > c3 > > and not: > a1 > a2 > a3 > c1 > c2 > c3 > > I'm just using a basic "print $var (+1,1)" command and have been through the > code about a million times to see if I might have an extra "print" > statement in my exclusion processing, but I can't find anything. > > Has anyone encountered anything like this? Any suggestions of things to > check that could cause this? > > Thanks! > Marc > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 12 08:47:38 2005 Date: Tue, 12 Apr 2005 15:43:33 +0200 From: edwin.hommes@bluewin.ch Subject: RE: [sqr-users] blank line being inserted unexpectedly while issuing Hi Marc, As suggested you could try something like "print $var (+1,1) | 'X' "=20 to see if your select parses a blank value Some thing else might be your pagesize if the break appears at regular inte= vals (every 42 lines or so). If so, you should increase your page-size to 32000. Alternatively you could change your print command to a writeline command. Hope this helps, Edwin Beginn der beigef=FCgten Nachricht From: marc pechaitis Subject: [sqr-users] blank line being inserted unexpectedly while issuing print commands Date: Mon, 11 Apr 2005 19:27:17 -0600 To: sqr-users@sqrug.org Hello All - You've been super helpful to me in the past, and I've got another problem that has me stumped. I am writing a report that selects a row of data from a table and based on the data in that row, it may decide to omit the line from the report. So let's say I have table: row 1 - a1 row 2 - a2 row 3 - a3 row 4 - b1 row 5 - b2 row 6 - b3 row 7 - c1 row 8 - c2 row 9 - c3 And I know that, based on the content of row 5 (b2) that I want to omit rows 4-6 (the b's). I've got the logic working so that all three rows are omiitted, but for some reason the output is: a1 a2 a3 c1 c2 c3 and not: a1 a2 a3 c1 c2 c3 I'm just using a basic "print $var (+1,1)" command and have been through the code about a million times to see if I might have an extra "print" statement in my exclusion processing, but I can't find anything. Has anyone encountered anything like this? Any suggestions of things to check that could cause this? Thanks! Marc _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 12 08:50:38 2005 From: "Lynds,Rick" Subject: RE: [sqr-users] blank line being inserted unexpectedly whileissui ngprint commands Date: Tue, 12 Apr 2005 06:46:45 -0700 -----Original Message----- From: sqr-users-bounces+rlynds=mwdh2o.com@sqrug.org [mailto:sqr-users-bounces+rlynds=mwdh2o.com@sqrug.org] On Behalf Of marc pechaitis Sent: Tuesday, April 12, 2005 6:40 AM To: This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions. Subject: Re: [sqr-users] blank line being inserted unexpectedly whileissuingprint commands Steve, This is what I am using for the processing of the report: @#@#@#@#@#@#@#@#@#@#@#start begin-procedure Get-Transcript-Info Columns 1 90 Let #bottom-line = 56 begin-Select A.REPORT_REQUEST_NBR, A.REQUEST_SEQ_NBR, C.TSCRPT_TYPE, A.REPORT_NUMBER, B.COPY_NUMBER, A.REPORT_LINE_NBR, A.TSCRPT_COMP_CODE, A.TSCRPT_COMP_DATA, A.DISPLAY_ATTR, B.TSCRPT_TITLE, B.TSCRPT_INS_ADDR1, B.TSCRPT_INS_ADDR2, B.TSCRPT_INS_ADDR3, B.TSCRPT_INS_ADDR4, B.TSCRPT_INS_ADDR5, B.TSCRPT_INS_ADDR6, B.TSCRPT_INS_ADDR7, B.TSCRPT_EM_ADDR1, B.TSCRPT_EM_ADDR2, B.TSCRPT_EM_ADDR3, B.TSCRPT_EM_ADDR4, B.TSCRPT_EM_ADDR5, B.TSCRPT_EM_ADDR6, B.TSCRPT_EM_ADDR7, B.TSCRPT_EM_ADDR8, B.TSCRPT_EM_ADDR9, B.TSCRPT_EM_ADDR10, B.TSCRPT_EM_ADDR11, Let $DisplayAttr = Rtrim(&A.DISPLAY_ATTR,' ') Let $TranscriptLine = Rtrim(&A.TSCRPT_COMP_DATA,' ') Let $TranscriptType = Rtrim(&C.TSCRPT_TYPE, ' ') Let $TrimmedTransLine = Ltrim($TranscriptLine, ' ') Let $OtherLine = 'Y' if #current-line >= #bottom-line Next-Column Goto-Top=1 At-End=NewPage Let $Subject = substr($TranscriptLine, 1, 8) Let $CatalogNbr = substr($TranscriptLine, 11, 10) Evaluate $TranscriptType When = 'OFFIC' do Proc-Transcript-Line-OFFIC break When = 'OFFEX' do Proc-Transcript-Line-OFFEX break When-Other if ($DisplayAttr = 'B') print $TranscriptLine (+1,1) bold else print $TranscriptLine (+1,1) end-if end-evaluate else Let $Subject = substr($TranscriptLine, 1, 8) Let $CatalogNbr = substr($TranscriptLine, 11, 10) Evaluate $TranscriptType When = 'OFFIC' do Proc-Transcript-Line-OFFIC break When = 'OFFEX' do Proc-Transcript-Line-OFFEX break When-Other if ($DisplayAttr = 'B') print $TranscriptLine (+1,1) bold else print $TranscriptLine (+1,1) end-if end-evaluate end-if FROM PS_SA_REPORT_RSLT A, PS_SA_RPT_RSLT_HDR B, PS_SA_REQUEST_HDR C WHERE A.REPORT_REQUEST_NBR = $ReptReqstID AND A.REQUEST_SEQ_NBR = $ReptReqstSeq AND A.REPORT_REQUEST_NBR = B.REPORT_REQUEST_NBR AND A.REPORT_REQUEST_NBR = $ReptReqstID AND A.REPORT_REQUEST_NBR = C.REPORT_REQUEST_NBR AND A.REQUEST_SEQ_NBR = B.REQUEST_SEQ_NBR AND A.REPORT_NUMBER = B.REPORT_NUMBER AND A.TSCRPT_COMP_CODE NOT LIKE 'T0%' AND A.TSCRPT_COMP_CODE NOT LIKE 'IN%' AND A.TSCRPT_COMP_CODE NOT LIKE 'EM%' ORDER BY 1, 2, 3, 5 end-Select end-procedure !Get-Transcript-Info @#@#@#@#@#@#@#@#@#@#@#end And I suspect that the lines: if #current-line >= #bottom-line Next-Column Goto-Top=1 At-End=NewPage are the ones that could be issuing the line extra line feeds...is this possible? Is there any way to supress this? (I have included these lines to print the report two columns of one "page" to a landscape sheet). Thanks, Marc On Apr 12, 2005 4:10 AM, Steve Cavill wrote: > Do you have a next-listing or position() command, they also cause line > feeds. > Steve > > -----Original Message----- > From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org > [mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] > On Behalf Of marc pechaitis > Sent: Tuesday, 12 April 2005 11:27 AM > To: sqr-users@sqrug.org > Subject: [sqr-users] blank line being inserted unexpectedly while > issuingprint commands > > Hello All - > You've been super helpful to me in the past, and I've got another > problem that has me stumped. > > I am writing a report that selects a row of data from a table and > based on the data in that row, it may decide to omit the line from the report. > > So let's say I have table: > row 1 - a1 > row 2 - a2 > row 3 - a3 > row 4 - b1 > row 5 - b2 > row 6 - b3 > row 7 - c1 > row 8 - c2 > row 9 - c3 > > And I know that, based on the content of row 5 (b2) that I want to > omit rows > 4-6 (the b's). I've got the logic working so that all three rows are > omiitted, but for some reason the output is: > > a1 > a2 > a3 > > c1 > c2 > c3 > > and not: > a1 > a2 > a3 > c1 > c2 > c3 > > I'm just using a basic "print $var (+1,1)" command and have been > through the code about a million times to see if I might have an extra "print" > statement in my exclusion processing, but I can't find anything. > > Has anyone encountered anything like this? Any suggestions of things > to check that could cause this? > > Thanks! > Marc > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 14 15:22:02 2005 Date: Thu, 14 Apr 2005 16:21:24 -0400 From: "Bolton, Kathleen" Subject: [sqr-users] How to get the PDF Format when direct printing I'm a PeopleSoft user and I'm working with the Purchase Order printing SQR (POPO005.sqr). I've modified the code to format the PO and it prints great when the PDF format is selected. The problem is my users want to send the output directly to the printer ---- Type =3D Printer, Format=3DHP. When I send the output directly to the printer the formatting is off ---- margins are pushed out, footer goes to multiple pages, boxes are cut-off. =20 Is there an easy way to retain the formatting and get the 'direct to printer' option to work? I'd rather not modify the SQR further because I'll just have a printer version that works and then the PDF option will be off. =20 Any suggestions? =20 Kathy Bolton _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 10:16:10 2005 Date: Fri, 15 Apr 2005 11:15:14 -0400 From: "Kaithi, Murali" Subject: [sqr-users] Insert duplicates Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 10:55:38 2005 Subject: RE: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 11:54:48 -0400 From: "Kaithi, Murali" Hi Gina, Thanks for your response. The value of #sql-status is -9 Even if I added break its doing the same thing. I don't believe that the Current value of -9 and when-other are executing the code under the when-other clause. Any suggestions. Thanks, Murali -----Original Message----- From: Gina Bencke [mailto:g.bencke@csuohio.edu]=20 Sent: Friday, April 15, 2005 11:28 AM To: Kaithi, Murali Subject: RE: [sqr-users] Insert duplicates Kaithi, What is the value of #sql-status? If it is -9 and you want to skip the error you need to add a break statement=20 when =3D -9 !unique constraint for Oracle Environments break Currently values of -9 and when-other are executing the code under the when-other clause Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:15 AM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions. Subject: [sqr-users] Insert duplicates Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 10:58:43 2005 Date: Fri, 15 Apr 2005 11:54:17 -0400 From: "Jamie Harris" Subject: Re: [sqr-users] Insert duplicates One sure way to prevent a dupe is to perform a select first and look for a row matching the keys of what you are about to insert. This works well if you are inserting rows one at a time - perhaps from a datafile or something. Like this: let #found = 0 begin-select FIELD let #found = 1 from TABLE WHERE (etc.) end-select if (not #found) begin-sql INSERT INTO (etc.) end-sql end-if Of course this slows everything down - so be aware of that. ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> Murali.Kaithi@spencergifts.com 4/15/2005 11:15 AM >>> Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like begin-sql ON-ERROR=SQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when = 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when = 6100 !DB2 error for empty-table result set break #end-if when = -99999 !Token "when" clause for non-DB2 environments when = -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement = ' display $SQL-STATEMENT display 'SQL Status =' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error = ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 11:13:25 2005 Subject: RE: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 11:12:50 -0500 From: "Knapp, Richard" A faster way (one pass) may be to order the select on the key of interest, store the key in a temp variable, get the next row, compare the key values and act accordingly, replace the value in the temp variable, get the next row, etc.. You have to make sure you handle the first and last rows appropriately in this method. Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org] On Behalf Of Jamie Harris Sent: Friday, April 15, 2005 10:54 AM To: sqr-users@sqrug.org Subject: Re: [sqr-users] Insert duplicates =20 One sure way to prevent a dupe is to perform a select first and look for a row matching the keys of what you are about to insert.=20=20 =20 This works well if you are inserting rows one at a time - perhaps from a datafile or something.=20=20 =20 Like this: =20 let #found =3D 0 begin-select FIELD let #found =3D 1 from TABLE WHERE (etc.) end-select =20 if (not #found) begin-sql INSERT INTO (etc.) end-sql end-if =20 Of course this slows everything down - so be aware of that. =20 ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> Murali.Kaithi@spencergifts.com 4/15/2005 11:15 AM >>> Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 11:18:38 2005 Subject: RE: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 12:17:27 -0400 From: "Gallagher, Neil \(IT HR Support\)" You might try adding a clause to your Insert SQL to say something like and not exists=20 (Select * from target-table Where target.key1=3D source.key1 And target.key2=3D source.key2 And target.key3=3D source.key3 ) This would nip the errors in the bud. Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 -----Original Message----- From: sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org [mailto:sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:55 AM To: g.bencke@csuohio.edu Cc: This list is for discussion about the SQR database reportinglanguagefromHyperion Solutions. Subject: RE: [sqr-users] Insert duplicates Hi Gina, Thanks for your response. The value of #sql-status is -9 Even if I added break its doing the same thing. I don't believe that the Current value of -9 and when-other are executing the code under the when-other clause. Any suggestions. Thanks, Murali -----Original Message----- From: Gina Bencke [mailto:g.bencke@csuohio.edu]=20 Sent: Friday, April 15, 2005 11:28 AM To: Kaithi, Murali Subject: RE: [sqr-users] Insert duplicates Kaithi, What is the value of #sql-status? If it is -9 and you want to skip the error you need to add a break statement=20 when =3D -9 !unique constraint for Oracle Environments break Currently values of -9 and when-other are executing the code under the when-other clause Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:15 AM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions. Subject: [sqr-users] Insert duplicates Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 13:38:08 2005 Subject: RE: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 13:37:25 -0500 From: "Turner, Ivan" To really, truly do it in one pass, use "exists" INSERT INTO INVC_CUST_REPORT (CUSTOMER_ACCT_ID, REPORT_ID) SELECT #customer_id, 1 FROM DUAL WHERE NOT EXISTS (SELECT 'X' FROM INVC_CUST_REPORT WHERE CUSTOMER_ACCT_ID =3D #customer_id AND REPORT_ID =3D 1) and exists ( select 'x' from customer_acct where customer_acct_id =3D #Customer_ID ) -----Original Message----- From: sqr-users-bounces+ivan.turner=3Dqwest.com@sqrug.org [mailto:sqr-users-bounces+ivan.turner=3Dqwest.com@sqrug.org] On Behalf Of Gallagher, Neil (IT HR Support) Sent: Friday, April 15, 2005 12:17 PM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions.; g.bencke@csuohio.edu Subject: RE: [sqr-users] Insert duplicates You might try adding a clause to your Insert SQL to say something like and not exists=20 (Select * from target-table Where target.key1=3D source.key1 And target.key2=3D source.key2 And target.key3=3D source.key3 ) This would nip the errors in the bud. Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 -----Original Message----- From: sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org [mailto:sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:55 AM To: g.bencke@csuohio.edu Cc: This list is for discussion about the SQR database reportinglanguagefromHyperion Solutions. Subject: RE: [sqr-users] Insert duplicates Hi Gina, Thanks for your response. The value of #sql-status is -9 Even if I added break its doing the same thing. I don't believe that the Current value of -9 and when-other are executing the code under the when-other clause. Any suggestions. Thanks, Murali -----Original Message----- From: Gina Bencke [mailto:g.bencke@csuohio.edu]=20 Sent: Friday, April 15, 2005 11:28 AM To: Kaithi, Murali Subject: RE: [sqr-users] Insert duplicates Kaithi, What is the value of #sql-status? If it is -9 and you want to skip the error you need to add a break statement=20 when =3D -9 !unique constraint for Oracle Environments break Currently values of -9 and when-other are executing the code under the when-other clause Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:15 AM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions. Subject: [sqr-users] Insert duplicates Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 14:43:16 2005 From: Al H Subject: Re: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 12:38:24 -0700 I've found that the -9 in #sql-status is unreliable in Oracle environments. Use $sql-error instead. Try this: if instr($sql-error,'unique constraint',0) =3D 0 ! Not a duplicate key else ! duplicate key end-if On Fri, 15 Apr 2005 11:54:48 -0400, you wrote: >Hi Gina, >Thanks for your response. >The value of #sql-status is -9 >Even if I added break its doing the same thing. >I don't believe that the Current value of -9 and when-other are >executing the code under the when-other clause. >Any suggestions. > >Thanks, >Murali > >-----Original Message----- >From: Gina Bencke [mailto:g.bencke@csuohio.edu]=20 >Sent: Friday, April 15, 2005 11:28 AM >To: Kaithi, Murali >Subject: RE: [sqr-users] Insert duplicates > > >Kaithi, > >What is the value of #sql-status? If it is -9 and you want to skip the >error you need to add a break statement=20 > when =3D -9 !unique constraint for Oracle Environments > break > >Currently values of -9 and when-other are executing the code under the >when-other clause > >Gina Bencke >216-875-9630 >=20 >=20 >-----Original Message----- >From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org >[mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of >Kaithi, Murali >Sent: Friday, April 15, 2005 11:15 AM >To: This list is for discussion about the SQR database reportinglanguage >fromHyperion Solutions. >Subject: [sqr-users] Insert duplicates > >Hi, >I am trying to insert into a table from another table. >If I get across the duplicates, I would like to skip them and insert >rest of the rows. >I remember the below code worked before but is not now, I am confused. >Could someone help me. >My insert statement would start like=20 > >begin-sql ON-ERROR=3DSQL-Error1 > >And below is my SQL-Error1 procedure > >begin-procedure SQL-Error1 > show '#sql-status is ' #sql-status > evaluate #sql-status >#ifdef DB2 > when =3D 6100 !DB2 error for empty-table result set > break >#end-if > >#ifdef DB2UNIX > when =3D 6100 !DB2 error for empty-table result set > break >#end-if > > when =3D -99999 !Token "when" clause for non-DB2 environments > when =3D -9 !unique constraint for Oracle Environments > when-other > display $sqr-program noline > display ': ' noline > display $ReportID noline > display ' - SQL Statement =3D ' > display $SQL-STATEMENT > display 'SQL Status =3D' noline > display #sql-status 99999 noline > display ' ' noline > display 'SQL Error =3D ' noline > display $sql-error > display $Sql-Msg > SHOW $loadrecord > Do Rollback-Transaction > stop > end-evaluate >end-procedure SQL-Error1 > >Thanks, >Murali > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 14:56:00 2005 Date: Fri, 15 Apr 2005 15:54:55 -0400 From: "Gallagher, Neil \(IT HR Support\)" Subject: [sqr-users] Getting complete listing of SQR code We run SQRs as batch jobs on a z/OS mainframe. When we have a syntax error, the diagnostics show line numbers, but we do not get a full listing that expands all the included members. =20 Is there any way to get a full listing? =20 Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 15:07:19 2005 Subject: RE: [sqr-users] Getting complete listing of SQR code Date: Fri, 15 Apr 2005 15:06:39 -0500 From: "Knapp, Richard" I have never found a way to get a comprehensive line number. The best you can hope for is the name of the module where the error occurred (in my experience). Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org] On Behalf Of Gallagher, Neil (IT HR Support) Sent: Friday, April 15, 2005 2:55 PM To: sqr-users@sqrug.org Subject: [sqr-users] Getting complete listing of SQR code We run SQRs as batch jobs on a z/OS mainframe. When we have a syntax error, the diagnostics show line numbers, but we do not get a full listing that expands all the included members. =20 Is there any way to get a full listing? =20 Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 15:10:16 2005 Subject: RE: [sqr-users] Insert duplicates Date: Fri, 15 Apr 2005 15:08:41 -0500 From: "Raja Iqbal" Any duplicates can be ignored using flag concept.=20 e.g: Before inserting record into table, check flag value True/False. i.e: var1, var2, var3 --> Recordset variables fvar1, fvar2, fvar3 --> Flag Variables or Temp Variables. If var1 =3D fvar1 and var2 =3D fvar2 and var3 =3D fvar3 Then ** It means previous record selected or inserted is same=20 --- Ignore Insert statement. Else --- execute insert statement=20 --- assign variable values to flag variables. End If Try out this. Raja -----Original Message----- From: sqr-users-bounces+riqbal=3Droosevelt.edu@sqrug.org [mailto:sqr-users-bounces+riqbal=3Droosevelt.edu@sqrug.org]On Behalf Of Turner, Ivan Sent: Friday, April 15, 2005 1:37 PM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions.; g.bencke@csuohio.edu Subject: RE: [sqr-users] Insert duplicates To really, truly do it in one pass, use "exists" INSERT INTO INVC_CUST_REPORT (CUSTOMER_ACCT_ID, REPORT_ID) SELECT #customer_id, 1 FROM DUAL WHERE NOT EXISTS (SELECT 'X' FROM INVC_CUST_REPORT WHERE CUSTOMER_ACCT_ID =3D #customer_id AND REPORT_ID =3D 1) and exists ( select 'x' from customer_acct where customer_acct_id =3D #Customer_ID ) -----Original Message----- From: sqr-users-bounces+ivan.turner=3Dqwest.com@sqrug.org [mailto:sqr-users-bounces+ivan.turner=3Dqwest.com@sqrug.org] On Behalf Of Gallagher, Neil (IT HR Support) Sent: Friday, April 15, 2005 12:17 PM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions.; g.bencke@csuohio.edu Subject: RE: [sqr-users] Insert duplicates You might try adding a clause to your Insert SQL to say something like and not exists=20 (Select * from target-table Where target.key1=3D source.key1 And target.key2=3D source.key2 And target.key3=3D source.key3 ) This would nip the errors in the bud. Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 -----Original Message----- From: sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org [mailto:sqr-users-bounces+ngallagher=3Dunumprovident.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:55 AM To: g.bencke@csuohio.edu Cc: This list is for discussion about the SQR database reportinglanguagefromHyperion Solutions. Subject: RE: [sqr-users] Insert duplicates Hi Gina, Thanks for your response. The value of #sql-status is -9 Even if I added break its doing the same thing. I don't believe that the Current value of -9 and when-other are executing the code under the when-other clause. Any suggestions. Thanks, Murali -----Original Message----- From: Gina Bencke [mailto:g.bencke@csuohio.edu]=20 Sent: Friday, April 15, 2005 11:28 AM To: Kaithi, Murali Subject: RE: [sqr-users] Insert duplicates Kaithi, What is the value of #sql-status? If it is -9 and you want to skip the error you need to add a break statement=20 when =3D -9 !unique constraint for Oracle Environments break Currently values of -9 and when-other are executing the code under the when-other clause Gina Bencke 216-875-9630 =20 =20 -----Original Message----- From: sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org [mailto:sqr-users-bounces+gina.work=3Dbencke.com@sqrug.org] On Behalf Of Kaithi, Murali Sent: Friday, April 15, 2005 11:15 AM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions. Subject: [sqr-users] Insert duplicates Hi, I am trying to insert into a table from another table. If I get across the duplicates, I would like to skip them and insert rest of the rows. I remember the below code worked before but is not now, I am confused. Could someone help me. My insert statement would start like=20 begin-sql ON-ERROR=3DSQL-Error1 And below is my SQL-Error1 procedure begin-procedure SQL-Error1 show '#sql-status is ' #sql-status evaluate #sql-status #ifdef DB2 when =3D 6100 !DB2 error for empty-table result set break #end-if #ifdef DB2UNIX when =3D 6100 !DB2 error for empty-table result set break #end-if when =3D -99999 !Token "when" clause for non-DB2 environments when =3D -9 !unique constraint for Oracle Environments when-other display $sqr-program noline display ': ' noline display $ReportID noline display ' - SQL Statement =3D ' display $SQL-STATEMENT display 'SQL Status =3D' noline display #sql-status 99999 noline display ' ' noline display 'SQL Error =3D ' noline display $sql-error display $Sql-Msg SHOW $loadrecord Do Rollback-Transaction stop end-evaluate end-procedure SQL-Error1 Thanks, Murali ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email=20 ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 15:16:18 2005 Subject: RE: [sqr-users] Getting complete listing of SQR code Date: Fri, 15 Apr 2005 15:17:33 -0500 From: "Raja Iqbal" Follow SQR Server Version 4.3.4 and the bin directory contains the SQR Serv= er executable files and any associated run-time files. Check the option for= bin or run time file which should provide to view detailed error listing. Also the sample directory contains sample SQR programs and associated data = files. The tutorial directory contains SQR tutorial programs, and tutorial = output files used in the SQR User's Guide Raja Iqbal -----Original Message----- From: sqr-users-bounces+riqbal=3Droosevelt.edu@sqrug.org [mailto:sqr-users-bounces+riqbal=3Droosevelt.edu@sqrug.org]On Behalf Of Knapp, Richard Sent: Friday, April 15, 2005 3:07 PM To: This list is for discussion about the SQR database reportinglanguage fromHyperion Solutions. Subject: RE: [sqr-users] Getting complete listing of SQR code I have never found a way to get a comprehensive line number. The best you can hope for is the name of the module where the error occurred (in my experience). Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org] On Behalf Of Gallagher, Neil (IT HR Support) Sent: Friday, April 15, 2005 2:55 PM To: sqr-users@sqrug.org Subject: [sqr-users] Getting complete listing of SQR code We run SQRs as batch jobs on a z/OS mainframe. When we have a syntax error, the diagnostics show line numbers, but we do not get a full listing that expands all the included members. =20 Is there any way to get a full listing? =20 Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 =20 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 15:21:57 2005 Subject: RE: [sqr-users] Insert duplicates Date: Sat, 16 Apr 2005 01:47:22 +0530 From: "Karunakaran Perumbrayoor" --===============1948603872== content-class: urn:content-classes:message Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 TXVyYWxpLA0KIA0KICAgICAgICAgIERpZCB1IHRyeSBwcmludGluZyB0aGUg I3NxbC1zdGF0dXM/IFdoeSBkbyBVIG5lZWQgdG8gdXNlIHByb2NlZHVyZXMg bGlrZSBTUUwtRXJyb3IxLiBUaGVyZSB3aWxsIGJlIGF0IHByZXNlbnQgb25s eSBhbiBVbmlxdWUgQ29uc3RyYWludCBFcnJvciB0byBiZSB0YWtlbiBjYXJl IG9mLiBJIGRvbnQgc2VlIHVyIGNvZGUgY2hlY2tpbmcgZm9yIG90aGVyIGNv bmRpdGlvbnMuIEkgdGhpbmsgYnkgc29tZSB3YXksIHlvdXIgY29kZSBpcyBl eGVjdXRpbmcgd2hlbi1vdGhlciBsb29wIGFuZCBwcm9jZXNzaW5nIFJvbGxC YWNrLVRyYW5zYWN0aW9uIFByb2NlZHVyZSB3aGljaCB3aWxsIGJlIHNlZW4g aW4gc3FsZXJyLnNxYy4gVGhlbiBhIFN0b3AgaXMgaXNzdWVkLiBJbiB0aGUg ZW5kLCB0aGUgUHJvZ3JhbSBhYm9ydHMgZHVlIHRvIFVuaXF1ZSBDb25zdHJh aW50LiBTbyB3aGF0IGRvIFUgZG8gZm9yIHRoYXQ/Pw0KIA0Kd2hlbi1vdGhl cg0KPiAgICAgIGRpc3BsYXkgJHNxci1wcm9ncmFtIG5vbGluZQ0KPiAgICAg IGRpc3BsYXkgJzogJyBub2xpbmUNCj4gICAgICBkaXNwbGF5ICRSZXBvcnRJ RCBub2xpbmUNCj4gICAgICBkaXNwbGF5ICcgLSBTUUwgU3RhdGVtZW50ID0g Jw0KPiAgICAgIGRpc3BsYXkgJFNRTC1TVEFURU1FTlQNCj4gICAgICBkaXNw bGF5ICdTUUwgU3RhdHVzID0nIG5vbGluZQ0KPiAgICAgIGRpc3BsYXkgI3Nx bC1zdGF0dXMgOTk5OTkgbm9saW5lDQo+ICAgICAgZGlzcGxheSAnICcgbm9s aW5lDQo+ICAgICAgZGlzcGxheSAnU1FMIEVycm9yICA9ICcgbm9saW5lDQo+ ICAgICAgZGlzcGxheSAkc3FsLWVycm9yDQo+ICAgICAgZGlzcGxheSAkU3Fs LU1zZw0KPiAgIFNIT1cgICRsb2FkcmVjb3JkDQo+ICAgICAgRG8gUm9sbGJh Y2stVHJhbnNhY3Rpb24NCj4gICAgICBzdG9wDQogDQogDQpJdCBpcyBiZXR0 ZXIsIFUgZG8gYSBkaXNwbGF5IG9mIHRoZSBlcnJvciBtZXNzYWdlIGFuZCBz dGF0dXMuIERvbnQgZG8gYW55IHN1Y2ggYWN0aXZpdGllcyBsaWtlIFJvbGxi YWNrIG9yIFN0b3AuIFRoYXQgc2hvdWxkIHNlcnZlIHRoZSBwdXJwb3NlLg0K WW91ciBzZWxlY3Qgd2lsbCBjb250aW51ZSB0byBwcm9jZXNzIHJlc3Qgb2Yg dGhlIHJvd3MuDQogDQpSZWdhcmRzLi4uDQpLYXJ1bg0KDQoJLS0tLS1Pcmln aW5hbCBNZXNzYWdlLS0tLS0gDQoJRnJvbTogQWwgSCBbbWFpbHRvOm1haWxs aXN0c0BzdGFyYnVja2submV0XSANCglTZW50OiBTYXQgMTYtQXByLTIwMDUg MTowOCBBTSANCglUbzogc3FyLXVzZXJzQHNxcnVnLm9yZyANCglDYzogDQoJ U3ViamVjdDogUmU6IFtzcXItdXNlcnNdIEluc2VydCBkdXBsaWNhdGVzDQoJ DQoJDQpJJ3ZlIGZvdW5kIHRoYXQgdGhlIC05IGluICNzcWwtc3RhdHVzIGlz IHVucmVsaWFibGUgaW4gT3JhY2xlDQplbnZpcm9ubWVudHMuIFVzZSAkc3Fs LWVycm9yIGluc3RlYWQuICBUcnkgdGhpczoNCg0KICAgaWYgaW5zdHIoJHNx bC1lcnJvciwndW5pcXVlIGNvbnN0cmFpbnQnLDApID0gIDANCiAgICAgICAh IE5vdCBhIGR1cGxpY2F0ZSBrZXkNCiAgZWxzZQ0KICAgICAgICEgZHVwbGlj YXRlIGtleQ0KICBlbmQtaWYNCg0KDQpPbiBGcmksIDE1IEFwciAyMDA1IDEx OjU0OjQ4IC0wNDAwLCB5b3Ugd3JvdGU6DQoNCj5IaSBHaW5hLA0KPlRoYW5r cyBmb3IgeW91ciByZXNwb25zZS4NCj5UaGUgdmFsdWUgb2YgI3NxbC1zdGF0 dXMgaXMgLTkNCj5FdmVuIGlmIEkgYWRkZWQgYnJlYWsgaXRzIGRvaW5nIHRo ZSBzYW1lIHRoaW5nLg0KPkkgZG9uJ3QgYmVsaWV2ZSB0aGF0IHRoZSBDdXJy ZW50IHZhbHVlIG9mIC05IGFuZCB3aGVuLW90aGVyIGFyZQ0KPmV4ZWN1dGlu ZyB0aGUgY29kZSB1bmRlciB0aGUgd2hlbi1vdGhlciBjbGF1c2UuDQo+QW55 IHN1Z2dlc3Rpb25zLg0KPg0KPlRoYW5rcywNCj5NdXJhbGkNCj4NCj4tLS0t LU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPkZyb206IEdpbmEgQmVuY2tlIFtt YWlsdG86Zy5iZW5ja2VAY3N1b2hpby5lZHVdDQo+U2VudDogRnJpZGF5LCBB cHJpbCAxNSwgMjAwNSAxMToyOCBBTQ0KPlRvOiBLYWl0aGksIE11cmFsaQ0K PlN1YmplY3Q6IFJFOiBbc3FyLXVzZXJzXSBJbnNlcnQgZHVwbGljYXRlcw0K Pg0KPg0KPkthaXRoaSwNCj4NCj5XaGF0IGlzIHRoZSB2YWx1ZSBvZiAjc3Fs LXN0YXR1cz8gIElmIGl0IGlzIC05IGFuZCB5b3Ugd2FudCB0byBza2lwIHRo ZQ0KPmVycm9yIHlvdSBuZWVkIHRvIGFkZCBhIGJyZWFrIHN0YXRlbWVudA0K PiAgICB3aGVuID0gLTkgICAgICAhdW5pcXVlIGNvbnN0cmFpbnQgZm9yIE9y YWNsZSBFbnZpcm9ubWVudHMNCj4gICAgIGJyZWFrDQo+DQo+Q3VycmVudGx5 IHZhbHVlcyBvZiAtOSBhbmQgd2hlbi1vdGhlciBhcmUgZXhlY3V0aW5nIHRo ZSBjb2RlIHVuZGVyIHRoZQ0KPndoZW4tb3RoZXIgY2xhdXNlDQo+DQo+R2lu YSBCZW5ja2UNCj4yMTYtODc1LTk2MzANCj4NCj4NCj4tLS0tLU9yaWdpbmFs IE1lc3NhZ2UtLS0tLQ0KPkZyb206IHNxci11c2Vycy1ib3VuY2VzK2dpbmEu d29yaz1iZW5ja2UuY29tQHNxcnVnLm9yZw0KPlttYWlsdG86c3FyLXVzZXJz LWJvdW5jZXMrZ2luYS53b3JrPWJlbmNrZS5jb21Ac3FydWcub3JnXSBPbiBC ZWhhbGYgT2YNCj5LYWl0aGksIE11cmFsaQ0KPlNlbnQ6IEZyaWRheSwgQXBy aWwgMTUsIDIwMDUgMTE6MTUgQU0NCj5UbzogVGhpcyBsaXN0IGlzIGZvciBk aXNjdXNzaW9uIGFib3V0IHRoZSBTUVIgZGF0YWJhc2UgcmVwb3J0aW5nbGFu Z3VhZ2UNCj5mcm9tSHlwZXJpb24gU29sdXRpb25zLg0KPlN1YmplY3Q6IFtz cXItdXNlcnNdIEluc2VydCBkdXBsaWNhdGVzDQo+DQo+SGksDQo+SSBhbSB0 cnlpbmcgdG8gaW5zZXJ0IGludG8gYSB0YWJsZSBmcm9tIGFub3RoZXIgdGFi bGUuDQo+SWYgSSBnZXQgYWNyb3NzIHRoZSBkdXBsaWNhdGVzLCBJIHdvdWxk IGxpa2UgdG8gc2tpcCB0aGVtIGFuZCBpbnNlcnQNCj5yZXN0IG9mIHRoZSBy b3dzLg0KPkkgcmVtZW1iZXIgdGhlIGJlbG93IGNvZGUgd29ya2VkIGJlZm9y ZSBidXQgaXMgbm90IG5vdywgSSBhbSBjb25mdXNlZC4NCj5Db3VsZCBzb21l b25lIGhlbHAgbWUuDQo+TXkgaW5zZXJ0IHN0YXRlbWVudCB3b3VsZCBzdGFy dCBsaWtlDQo+DQo+YmVnaW4tc3FsIE9OLUVSUk9SPVNRTC1FcnJvcjENCj4N Cj5BbmQgYmVsb3cgaXMgbXkgU1FMLUVycm9yMSBwcm9jZWR1cmUNCj4NCj5i ZWdpbi1wcm9jZWR1cmUgU1FMLUVycm9yMQ0KPiAgc2hvdyAnI3NxbC1zdGF0 dXMgaXMgJyAjc3FsLXN0YXR1cw0KPiAgZXZhbHVhdGUgI3NxbC1zdGF0dXMN Cj4jaWZkZWYgREIyDQo+ICAgIHdoZW4gPSA2MTAwICAgICFEQjIgZXJyb3Ig Zm9yIGVtcHR5LXRhYmxlIHJlc3VsdCBzZXQNCj4gICAgICBicmVhaw0KPiNl bmQtaWYNCj4NCj4jaWZkZWYgREIyVU5JWA0KPiAgICB3aGVuID0gNjEwMCAg ICAhREIyIGVycm9yIGZvciBlbXB0eS10YWJsZSByZXN1bHQgc2V0DQo+ICAg ICAgYnJlYWsNCj4jZW5kLWlmDQo+DQo+ICAgIHdoZW4gPSAtOTk5OTkgICFU b2tlbiAid2hlbiIgY2xhdXNlIGZvciBub24tREIyIGVudmlyb25tZW50cw0K PiAgICB3aGVuID0gLTkgICAgICAhdW5pcXVlIGNvbnN0cmFpbnQgZm9yIE9y YWNsZSBFbnZpcm9ubWVudHMNCj4gICAgd2hlbi1vdGhlcg0KPiAgICAgIGRp c3BsYXkgJHNxci1wcm9ncmFtIG5vbGluZQ0KPiAgICAgIGRpc3BsYXkgJzog JyBub2xpbmUNCj4gICAgICBkaXNwbGF5ICRSZXBvcnRJRCBub2xpbmUNCj4g ICAgICBkaXNwbGF5ICcgLSBTUUwgU3RhdGVtZW50ID0gJw0KPiAgICAgIGRp c3BsYXkgJFNRTC1TVEFURU1FTlQNCj4gICAgICBkaXNwbGF5ICdTUUwgU3Rh dHVzID0nIG5vbGluZQ0KPiAgICAgIGRpc3BsYXkgI3NxbC1zdGF0dXMgOTk5 OTkgbm9saW5lDQo+ICAgICAgZGlzcGxheSAnICcgbm9saW5lDQo+ICAgICAg ZGlzcGxheSAnU1FMIEVycm9yICA9ICcgbm9saW5lDQo+ICAgICAgZGlzcGxh eSAkc3FsLWVycm9yDQo+ICAgICAgZGlzcGxheSAkU3FsLU1zZw0KPiAgIFNI T1cgICRsb2FkcmVjb3JkDQo+ICAgICAgRG8gUm9sbGJhY2stVHJhbnNhY3Rp b24NCj4gICAgICBzdG9wDQo+ICBlbmQtZXZhbHVhdGUNCj5lbmQtcHJvY2Vk dXJlIFNRTC1FcnJvcjENCj4NCj5UaGFua3MsDQo+TXVyYWxpDQo+DQoNCg0K X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X18NCnNxci11c2VycyBtYWlsaW5nIGxpc3QNCnNxci11c2Vyc0BzcXJ1Zy5v cmcNCmh0dHA6Ly93d3cuc3FydWcub3JnL21haWxtYW4vbGlzdGluZm8vc3Fy LXVzZXJzDQoNCg0KDQo= --===============1948603872== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users --===============1948603872==-- From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 15 16:03:50 2005 Subject: Re: [sqr-users] Getting complete listing of SQR code Date: Fri, 15 Apr 2005 21:03:19 -0000 From: In cases like this, you can establish a mirror of the mainframe SQRs by putting the source code through a tool like SQR Tree. It won't help on error identification but the tree like visual allows you to drill down into the includes and trace the code. See "dash board" white paper at http://www.dssltd.com for some examples or search SQRUG for SQR Tree. I have a legitmate copy but can not remember the author. (Not at my regular site). John Willson "Gallagher, Neil (IT HR Support)" said: > We run SQRs as batch jobs on a z/OS mainframe. When we have a syntax > error, the diagnostics show line numbers, but we do not get a full > listing that expands all the included members. > > > > Is there any way to get a full listing? > > > > Neil Gallagher > > UNUM Provident Corporation > > Corporate HR Systems Support Team > > (207) 575-8046 > > Mailstop T211 > > Colonel Westbrook Executive Park > > Westbrook, Maine 04092 > > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > -- _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun Apr 17 16:54:14 2005 From: "SRI Technologies" Subject: RE: [sqr-users] Getting complete listing of SQR code Date: Mon, 18 Apr 2005 07:54:50 -0700 SqrPlus is a comprehensive SQR development tool. It is an answer to all such questions/requirements. With latest version you can develop/debug SQR programs on Unix or any other windows or non-windows platforms. Further details available at www.sritech.com.au Susan. -----Original Message----- From: Gallagher, Neil (IT HR Support) [mailto:ngallagher@unumprovident.com] Sent: Friday, April 15, 2005 12:55 PM To: sqr-users@sqrug.org Subject: [sqr-users] Getting complete listing of SQR code We run SQRs as batch jobs on a z/OS mainframe. When we have a syntax error, the diagnostics show line numbers, but we do not get a full listing that expands all the included members. Is there any way to get a full listing? Neil Gallagher UNUM Provident Corporation Corporate HR Systems Support Team (207) 575-8046 Mailstop T211 Colonel Westbrook Executive Park Westbrook, Maine 04092 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 19 18:26:44 2005 Date: Tue, 19 Apr 2005 19:26:08 -0400 From: Meena Kandasamy Subject: [sqr-users] New hire Hi Everybody, I am designing a new hire report that will allow date mask of DD-MON-YYYY. I am validating the input with format='DD-MON-YYYY' But the publisher and program accepts the date value as DD-MON-YY. One of my collegues says its possible to do such format. She says we have to use type=date format. Any ideas? _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue Apr 19 18:37:28 2005 From: Bob Stone Subject: RE: [sqr-users] New hire Date: Tue, 19 Apr 2005 18:36:24 -0500 is that date input coming from a file or a database table? because if it's coming from the database table you can use date masks to bring it in...otherwise, you can turn it into the correct date format on the insert. For example you can grab the 'DD-MON-YY' from the table, and make it a DD-MON-YYYY in the string: begin-select to_char(a_date_DD_MON_YY, 'DD-MON-YYYY') &my_date let $my_date = &my_date from table where [$clause] end-select Or if it's an input from a file and you're trying to put it into the table you can put it in whatever format you need, and read it from the table like above: unstring $input by $sepchar $my_date BEGIN-SQL insert into table ( a_date_DD_MON_YY ) values ( to_date($my_date , 'DD-MON-YY') ) END-SQL If your SQR report doesn't make use of that date in any database tables, well that sorta confuses me, but maybe setting up a date variable and using the SQR edit masks would do it for you too. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Meena Kandasamy Sent: Tuesday, April 19, 2005 6:26 PM To: sqr-users@sqrug.org Subject: [sqr-users] New hire Hi Everybody, I am designing a new hire report that will allow date mask of DD-MON-YYYY. I am validating the input with format='DD-MON-YYYY' But the publisher and program accepts the date value as DD-MON-YY. One of my collegues says its possible to do such format. She says we have to use type=date format. Any ideas? _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 20 10:10:08 2005 From: "radhika reddy" Date: Wed, 20 Apr 2005 10:09:01 -0500 Subject: [sqr-users] Evaluate - When Hi, I am having a problem with delivered SQR. It has Evaluate Statement which codes like the following: Evaluate &Paygroup when = 'A' ! processing A break; when = 'B' when = 'C' !processing B or C Break; when = 'D' when = 'E' when-other ! processing D or E or other Break; End-Evaluate Here when the value of paygroup is B or C it goes into processing B or C. But when the value is D or E it doesn't go to Processing D or E or other. I can remove the lines of code when = 'D' and when = 'E' . But before making changes to the delivered one, i would like to know is there any reason for peoplesoft to code like this? Any input would be appreciated. Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 20 10:16:04 2005 Date: Wed, 20 Apr 2005 11:15:05 -0400 From: "Larry Roux" Subject: Re: [sqr-users] Evaluate - When I believe what is happening is that it is processing nothing for the 'D' 'E' options....that is it is acting like this: when = 'D' when = 'E' ! Do nothing when-other ! processing D or E or other Break; End-Evaluate If that is what they intended, then it is working. If they want the D E options to flow to the when-other clause then they just plain don't know what they are doing (no surprise there). Remove the 2 lines for D and E and it should work. Larry Roux Syracuse University lroux@syr.edu >>> radhika_05@hotmail.com 4/20/2005 11:09:01 AM >>> Hi, I am having a problem with delivered SQR. It has Evaluate Statement which codes like the following: Evaluate &Paygroup when = 'A' ! processing A break; when = 'B' when = 'C' !processing B or C Break; when = 'D' when = 'E' when-other ! processing D or E or other Break; End-Evaluate Here when the value of paygroup is B or C it goes into processing B or C. But when the value is D or E it doesn't go to Processing D or E or other. I can remove the lines of code when = 'D' and when = 'E' . But before making changes to the delivered one, i would like to know is there any reason for peoplesoft to code like this? Any input would be appreciated. Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 20 10:20:57 2005 Subject: Re: [sqr-users] Evaluate - When From: rick.hansen@rsmi.com Date: Wed, 20 Apr 2005 10:20:24 -0500 By removing the lines when='D' and when'E', I believe you will actually change the way this evaluate works. It appears that the original author does not want anything to occur if D or E. By removing the when's, then a D or E would fall into the OTHER clause. You would think that a break is needed but it appears that the when-other is handled a little bit differently. So, the question is: Should anything happen when D or E. If the answer is no, then I would leave it alone or perhaps put a break after the when='E' for better clarity. If the answer is, it should do the "other", then you would want to remove the when's. Rick Hansen Sr. Application Systems Analyst D - (563) 333-2321, F - (563) 324-0211 ________________________________________________________________________________ This e-mail is only intended for the person(s) to whom it is addressed and may contain confidential information. Unless stated to the contrary, any opinions or comments are personal to the writer and do not represent the official view of the company. If you have received this e-mail in error, please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use it for any purposes, or disclose its contents to any other person. Thank you for your cooperation. "radhika reddy" Sent by: sqr-users-bounces+rick.hansen=rsmi.com@sqrug.org 04/20/2005 10:09 AM Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." To: sqr-users@sqrug.org cc: Subject: [sqr-users] Evaluate - When Hi, I am having a problem with delivered SQR. It has Evaluate Statement which codes like the following: Evaluate &Paygroup when = 'A' ! processing A break; when = 'B' when = 'C' !processing B or C Break; when = 'D' when = 'E' when-other ! processing D or E or other Break; End-Evaluate Here when the value of paygroup is B or C it goes into processing B or C. But when the value is D or E it doesn't go to Processing D or E or other. I can remove the lines of code when = 'D' and when = 'E' . But before making changes to the delivered one, i would like to know is there any reason for peoplesoft to code like this? Any input would be appreciated. Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 20 10:23:59 2005 Date: Wed, 20 Apr 2005 11:21:34 -0400 From: "Jamie Harris" Subject: Re: [sqr-users] Evaluate - When That's strange. :) It looks like it should fall-through into the when-other if the value is D or E. I guess the programmer at Peoplesoft thought that's what it would do (and didn't test it!). You are correct about needing to remove the when = 'D' and when = 'E'. I would open a case with PS though, and let them know what you found and what you did to correct it. What PS delivered SQR was this in? ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> radhika_05@hotmail.com 4/20/2005 11:09 AM >>> Hi, I am having a problem with delivered SQR. It has Evaluate Statement which codes like the following: Evaluate &Paygroup when = 'A' ! processing A break; when = 'B' when = 'C' !processing B or C Break; when = 'D' when = 'E' when-other ! processing D or E or other Break; End-Evaluate Here when the value of paygroup is B or C it goes into processing B or C. But when the value is D or E it doesn't go to Processing D or E or other. I can remove the lines of code when = 'D' and when = 'E' . But before making changes to the delivered one, i would like to know is there any reason for peoplesoft to code like this? Any input would be appreciated. Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 20 11:23:14 2005 From: "radhika reddy" Subject: Re: [sqr-users] Evaluate - When Date: Wed, 20 Apr 2005 11:22:06 -0500 Thanks for replying. I opened a ticket with peoplesoft. This Sqr is in Health & Safety and the name of Sqr is OHS019. It should definetly go into the processing section when value is D or E. Will update. Thanks. >From: "Jamie Harris" >Reply-To: "This list is for discussion about the SQR database >reportinglanguage from Hyperion Solutions." >To: >Subject: Re: [sqr-users] Evaluate - When >Date: Wed, 20 Apr 2005 11:21:34 -0400 > >That's strange. :) > >It looks like it should fall-through into the when-other if the value >is D or E. I guess the programmer at Peoplesoft thought that's what it >would do (and didn't test it!). > >You are correct about needing to remove the when = 'D' and when = 'E'. >I would open a case with PS though, and let them know what you found and >what you did to correct it. > >What PS delivered SQR was this in? > > >----------------------------------------------------- >James Harris >Junior Systems Programmer/Analyst >Information Technology Division >Frederick Community College >----------------------------------------------------- > > >>> radhika_05@hotmail.com 4/20/2005 11:09 AM >>> > >Hi, > > I am having a problem with delivered SQR. It has Evaluate Statement >which >codes like the following: > >Evaluate &Paygroup >when = 'A' > ! processing A > break; >when = 'B' >when = 'C' > !processing B or C > Break; >when = 'D' >when = 'E' >when-other > ! processing D or E or other > Break; >End-Evaluate > > Here when the value of paygroup is B or C it goes into processing B >or >C. But when the value is D or E it doesn't go to Processing D or E or >other. > >I can remove the lines of code when = 'D' and when = 'E' . But before >making >changes to the delivered one, i would like to know is there any reason >for >peoplesoft to code like this? > >Any input would be appreciated. > >Thanks. > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today - it's >FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users _________________________________________________________________ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:23:23 2005 From: Bob Stone Date: Thu, 21 Apr 2005 11:22:17 -0500 Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:30:54 2005 From: James Womeldorf Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:29:48 -0500 Hi Bob, What are the values of the two dynamic where variables? Is it dying during compilation or during execution? Jim -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:33:49 2005 Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:31:23 -0500 From: "Knapp, Richard" Sometimes the error message is correct. Does your dynamic where string have a missing right paren? Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org] On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it.=20=20 Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date =3D &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt =3D #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage=20 where 1=3D1=20 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 =3D 1=20 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone=20=20 Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:40:02 2005 From: James Womeldorf Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:38:57 -0500 Try adding $necessary as I have done here. I think SQR is trying to compile this statement rather than waiting for run-time. It happens sometimes when there is a subselect. I usually signal SQR to wait by placing a dynamic sql variable after each 'from'. Jim let $necessary = '' BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM [$necessary] (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from [$necessary] sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:43:08 2005 From: Bob Stone Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:39:25 -0500 for the specific run i was doing the dynamic where clause was ' ' ...with no parens. It's not seeing the 2nd paren (which is there), that's the problem. And since it finds that 2nd paren when I comment out the ![$month_where_clause_1], that leads me to believe that the []'s of that dyamic where clause are what's causing it not to read the order by clause. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Knapp, Richard Sent: Thursday, April 21, 2005 11:31 AM To: This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions. Subject: RE: [sqr-users] dynamic where clause in subselect Sometimes the error message is correct. Does your dynamic where string have a missing right paren? Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=umsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=umsystem.edu@sqrug.org] On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:46:24 2005 From: Bob Stone Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:45:20 -0500 Jim (and Jeff), The $month_where_clause_1 is created to allow a date-range run of off the run cntl panel. 99% of the time they'll probably just run the default, but it's something i added and I would like it to work if possible. let $month_where_clause_1 = 'and ( (calendar_year = ' || $to_date_yr || ' and to_number(monthcd) <= ' || $to_date_mon || ') ' || ' or (calendar_year = ' || $from_date_yr || ' and to_number(monthcd) > ' || $from_date_mon || ') )' example: date range (12-01-2004, 04-01-2005). I grab out $to_date_yr (=2005) $to_date_mon (=04), etc. $month_where_clause_1 = "and ( (calendar_year = 2005 and to_number(monthcd) <= 4) or(calendar_year = 2004 and to_number(monthcd) > 12) )" I guess that's not exactly perfect (if run for 24 or 36 months, for example), but hey, that's a different problem. It's dying during compilation. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of James Womeldorf Sent: Thursday, April 21, 2005 11:30 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect Hi Bob, What are the values of the two dynamic where variables? Is it dying during compilation or during execution? Jim -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:50:22 2005 Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 11:48:36 -0500 From: Could you then pre-build your entire sub-query and include or not include the content of $month_where_clause_1 as appropriate? -----Original Message----- From: sqr-users-bounces+jeff.steinfeldt=3Dwellsfargo.com@sqrug.org [mailto:sqr-users-bounces+jeff.steinfeldt=3Dwellsfargo.com@sqrug.org] On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:39 AM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect for the specific run i was doing the dynamic where clause was ' ' ...with no parens.=20=20 It's not seeing the 2nd paren (which is there), that's the problem. And since it finds that 2nd paren when I comment out the ![$month_where_clause_1], that leads me to believe that the []'s of that dyamic where clause are what's causing it not to read the order by clause. -----Original Message----- From: sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org]On Behalf Of Knapp, Richard Sent: Thursday, April 21, 2005 11:31 AM To: This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions. Subject: RE: [sqr-users] dynamic where clause in subselect Sometimes the error message is correct. Does your dynamic where string have a missing right paren? Richard Knapp Database Programmer/Analyst Institutional Research and Planning University of Missouri System 573-882-8856 knappr@umsystem.edu -----Original Message----- From: sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org [mailto:sqr-users-bounces+knappr=3Dumsystem.edu@sqrug.org] On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it.=20=20 Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date =3D &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt =3D #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage=20 where 1=3D1=20 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 =3D 1=20 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone=20=20 Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 11:59:20 2005 From: "Alexander, Steve" Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 09:58:10 -0700 A $month_where_clause_1 will probably not make your query run much faster. The to_number function eliminates the possibility of using indexes, so you're examining every row anyway. The "or" in this example will make it harder for your SQL optimizer. You might be no worse off leaving out the dynamic clause. -----Original Message----- From: Bob Stone [mailto:bstone@fastenal.com] Sent: Thursday, April 21, 2005 9:45 AM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect Jim (and Jeff), The $month_where_clause_1 is created to allow a date-range run of off the run cntl panel. 99% of the time they'll probably just run the default, but it's something i added and I would like it to work if possible. let $month_where_clause_1 = 'and ( (calendar_year = ' || $to_date_yr || ' and to_number(monthcd) <= ' || $to_date_mon || ') ' || ' or (calendar_year = ' || $from_date_yr || ' and to_number(monthcd) > ' || $from_date_mon || ') )' example: date range (12-01-2004, 04-01-2005). I grab out $to_date_yr (=2005) $to_date_mon (=04), etc. $month_where_clause_1 = "and ( (calendar_year = 2005 and to_number(monthcd) <= 4) or(calendar_year = 2004 and to_number(monthcd) > 12) )" I guess that's not exactly perfect (if run for 24 or 36 months, for example), but hey, that's a different problem. It's dying during compilation. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of James Womeldorf Sent: Thursday, April 21, 2005 11:30 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect Hi Bob, What are the values of the two dynamic where variables? Is it dying during compilation or during execution? Jim -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 12:02:25 2005 Subject: Re: [sqr-users] dynamic where clause in subselect From: Olga.Gal@bbh.com Date: Thu, 21 Apr 2005 13:00:12 -0400 Bob, Just to make sure that you don't have a bug there, I suggest you add ON-ERROR clause to your BEGIN-SELECT statement, and add show_sql procedure where you display the oracle statement being executed: BEGIN-SELECT ON-ERROR=show_sql . . END-SELECT END-PROCEDURE BEGIN-PROCEDURE show_sql SHOW $sql-error SHOW 'Error in SQL statement: ' $sql-text END-PROCEDURE show_sql Bob Stone Sent by: sqr-users-bounces+olga.gal=bbh.com@sqrug.org To sqr-users@sqrug.org 04/21/2005 12:22 PM cc Subject Please respond to [sqr-users] dynamic where clause in subselect "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 14:10:40 2005 From: Bob Stone Subject: RE: [sqr-users] dynamic where clause in subselect Date: Thu, 21 Apr 2005 14:09:30 -0500 The 'dynamic' part of it is that 90% of the time I want it to be ' ' (no where clause)...but the rest of the time it might have that extra where clause. Yes, I could set up about 4 different non-dynamic SQLs that only get run inside certain IF statements, but performance isn't an issue in a Report that runs in under 2 seconds. I dont care how fast it runs, there's about 2-3000 rows in that table, 1337 rows in the other table. everything's fast. I just wanted it to run. It didn't run because it wasn't compiling. SQR was trying to parse out the SQL at compile time (it must not have noticed the 2 dynamic sections, which should make it parse at run time) and it got to the [] and was confused because it thought it was looking for the right paren ). Jim Womeldorf had the solution to incude more useless dynamic sections right after the FROM to make sure it knows that SQL section is dynamic (run time parsing). It worked for me. I was able to compile and the SQR compiled and ran fine. let $necessary = '' BEGIN-SELECT .... FROM [$necessary] (select .... from [$necessary] sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT Thanks for everyone's suggestions. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Alexander, Steve Sent: Thursday, April 21, 2005 11:58 AM To: 'This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect A $month_where_clause_1 will probably not make your query run much faster. The to_number function eliminates the possibility of using indexes, so you're examining every row anyway. The "or" in this example will make it harder for your SQL optimizer. You might be no worse off leaving out the dynamic clause. -----Original Message----- From: Bob Stone [mailto:bstone@fastenal.com] Sent: Thursday, April 21, 2005 9:45 AM To: 'This list is for discussion about the SQR database reporting languagefrom Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect Jim (and Jeff), The $month_where_clause_1 is created to allow a date-range run of off the run cntl panel. 99% of the time they'll probably just run the default, but it's something i added and I would like it to work if possible. let $month_where_clause_1 = 'and ( (calendar_year = ' || $to_date_yr || ' and to_number(monthcd) <= ' || $to_date_mon || ') ' || ' or (calendar_year = ' || $from_date_yr || ' and to_number(monthcd) > ' || $from_date_mon || ') )' example: date range (12-01-2004, 04-01-2005). I grab out $to_date_yr (=2005) $to_date_mon (=04), etc. $month_where_clause_1 = "and ( (calendar_year = 2005 and to_number(monthcd) <= 4) or(calendar_year = 2004 and to_number(monthcd) > 12) )" I guess that's not exactly perfect (if run for 24 or 36 months, for example), but hey, that's a different problem. It's dying during compilation. -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of James Womeldorf Sent: Thursday, April 21, 2005 11:30 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] dynamic where clause in subselect Hi Bob, What are the values of the two dynamic where variables? Is it dying during compilation or during execution? Jim -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Thursday, April 21, 2005 11:22 AM To: sqr-users@sqrug.org Subject: [sqr-users] dynamic where clause in subselect Hi there...i'm having a few problems with using a dynamic where clause within a subselect in the from clause (i forget the technical term for that). If I comment out the [$month_where_clause_1] the SQL runs in the SQR. When I have it in there it says 'ORA-00907: missing right parenthesis' meaning that it doesn't get as far as the ' monthcd desc )' of the order clause. The [] stop it. Has anybody seen this before? Any work arounds? I would really like to do this date logic (it's confusing because the table was made ~not by me, mind you~ with the 'date' being kept in a 'month' column and a 'year' column. since we only care what month it is..), and I would really like to not rewrite this sql (it was confusing enough the first time). Let me know if you see anything. ------------------------------------------------------------- BEGIN-SELECT calendar_year &year monthcd_num &monthcd full_date &full_date let $full_date = &full_date put $full_date into MONTHS_RUN_FOR(#monthcnt) month !YYYY-MM-DD let #monthcnt = #monthcnt + 1 FROM (select distinct calendar_year, monthcd, to_number(monthcd) as monthcd_num, calendar_year || '-' || monthcd || '-01' as full_date from sysadm.ps_fas_scan_usage where 1=1 [$month_where_clause_1] order by calendar_year desc, monthcd desc ) WHERE 1 = 1 [$month_where_clause_2] END-SELECT --------------------------------------------------- Thanks Bob Stone Fastenal PS AR/Billing Developer (507) 453-8514 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 21 17:51:30 2005 Date: Thu, 21 Apr 2005 15:50:12 -0700 From: Raghvendra Dharwada Subject: [sqr-users] Transferring output file within environments using SQR when the SQR Report is run on NT Hi all, Can anyone help me how to write a script in an SQR program that can transfer (copy) a file from one environment to another (say DEV to TST) (network folders) in Windows NT ? The scenario is like this: The SQR is run on NT. It creates an output file in DEV (in some folder) This file should be transferred to TST (in some folder) Here are the software versions I am using $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle 8.0.6/Mar 26= 2004 PeopleSoft: 8.8 Oracle: 9i I came across a script that transfers file from UNIX to NT i.e After the SQR runs on UNIX it transfers to NT. The code that I came across is as follows: I write the script in a file, execute it using the move-files procedure begin-procedure write-sh-file let $file-path =3D 'cd /home/out/payroll'=20=20 let $L1 =3D 'HOST=3D' || '''x.x.x.x''' let $L2 =3D 'USER=3D' || '''usename''' let $L3 =3D 'PASSWD=3D' || '''pwd''' let $L4 =3D 'echo ' || '"remote Login attempted"' let $L5 =3D 'ftp -n $HOST < 0 display ' call status: ' noline display #status3 end-if if #status3 =3D 0 display 'Unix script Executed' end-if End-Procedure Now I need a similar or any script, that when the SQR is run on NT and after it creates an output file in a specific folder in DEV, it should get transferred to a folder in TST or vice versa. Pls let me know Thanks Raghav _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 22 08:14:38 2005 Date: Fri, 22 Apr 2005 06:13:26 -0700 (PDT) From: Dattatraya Shetty Subject: Re: [sqr-users] Transferring output file within environments using SQR when the SQR Report is run on NT Hi Raghav, This might be fairly simple if you can create a share for the TST box and create a mapping on the machine where the SQR is running. e.g map Z: = \\TSTSERVER\sharedrive. Once you have this you can simply execute a copy command using the system call to copy the file that might be the quickest of all options. let $cmd = 'copy \\DEVSERVER\filename Z:\filename' call system using $cmd status=#stat ! check the return status. if not you may have to do an ftp. like in the script below, make sure there is an ftp program available on the NT box and try to manually ftp to the TST box from DEV and then you can use the script below with changes to hostname userid and password. etc HTH Datta. --- Raghvendra Dharwada wrote: > Hi all, > Can anyone help me how to write a script in an SQR program that can > transfer (copy) a file from one environment to another (say DEV to > TST) (network folders) in Windows NT ? > > The scenario is like this: > > The SQR is run on NT. > It creates an output file in DEV (in some folder) > This file should be transferred to TST (in some folder) > > Here are the software versions I am using > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > 8.0.6/Mar 26 2004 > PeopleSoft: 8.8 > Oracle: 9i > > I came across a script that transfers file from UNIX to NT i.e After > the SQR runs on UNIX > it transfers to NT. > The code that I came across is as follows: > I write the script in a file, execute it using the move-files > procedure > > begin-procedure write-sh-file > let $file-path = 'cd /home/out/payroll' > let $L1 = 'HOST=' || '''x.x.x.x''' > let $L2 = 'USER=' || '''usename''' > let $L3 = 'PASSWD=' || '''pwd''' > let $L4 = 'echo ' || '"remote Login attempted"' > let $L5 = 'ftp -n $HOST < let $L6 = 'quote USER $USER' > let $L7 = 'quote PASS $PASSWD' > let $L8 = 'cd /GL/Reports' > let $L9 = 'prompt' > let $L10 = 'put ' || $filename1 > let $L11 = 'END_SCRIPT' > let $L12 = 'FTP_RETURN_CODE=$?' > let $L13 = 'if [ $FTP_RETURN_CODE = 0 ]; then' > let $L14 = 'echo ' || '"Transfered Successful, deleting > source files"' > let $L15 = 'cd /home/out/payroll' > let $L16 = 'delete ' || $filename1 > let $L17 = 'exit 0' > let $L18 = 'else' > let $L19 = 'echo' || '"Transfered failed"' > let $L20 = 'exit 1' > let $L21 = 'fi' > > > write 2 from $file-path > write 2 from $L1 > ----- > ----- > > End-procedure > > In the above procedure : > $filename1 = $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > || '.csv' > > !----------------------------------------------------------------------- > !Procedure : move-files > !Called By : wrap-up > !----------------------------------------------------------------------- > begin-procedure move-files > let $path = '/export/home/psadmin/scripts/' > let $file = 'sh ' || $path || 'cbgl0007.sh' > > call system using $file #status3 > > if #status3 <> 0 > display ' call status: ' noline > display #status3 > end-if > if #status3 = 0 > display 'Unix script Executed' > end-if > > End-Procedure > > Now I need a similar or any script, that when the SQR is run on NT > and > after it creates an > output file in a specific folder in DEV, it should get transferred > to > a folder in TST > or vice versa. > Pls let me know > > Thanks > Raghav > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 22 08:34:15 2005 From: jeff_molloy@adp.com Subject: RE: [sqr-users] Transferring output file within environments usin g SQR when the SQR Report is run on NT Date: Fri, 22 Apr 2005 09:32:37 -0400 Also, if you do not want to map the drive, just put the \\TSTSERVER\sharedrive in double quotes. That will work also. "\\TSTSERVER\sharedrive" Jeff Molloy -----Original Message----- From: Dattatraya Shetty [mailto:datta_shetty@yahoo.com] Sent: Friday, April 22, 2005 9:13 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: Re: [sqr-users] Transferring output file within environments using SQR when the SQR Report is run on NT Hi Raghav, This might be fairly simple if you can create a share for the TST box and create a mapping on the machine where the SQR is running. e.g map Z: = \\TSTSERVER\sharedrive. Once you have this you can simply execute a copy command using the system call to copy the file that might be the quickest of all options. let $cmd = 'copy \\DEVSERVER\filename Z:\filename' call system using $cmd status=#stat ! check the return status. if not you may have to do an ftp. like in the script below, make sure there is an ftp program available on the NT box and try to manually ftp to the TST box from DEV and then you can use the script below with changes to hostname userid and password. etc HTH Datta. --- Raghvendra Dharwada wrote: > Hi all, > Can anyone help me how to write a script in an SQR program that can > transfer (copy) a file from one environment to another (say DEV to > TST) (network folders) in Windows NT ? > > The scenario is like this: > > The SQR is run on NT. > It creates an output file in DEV (in some folder) > This file should be transferred to TST (in some folder) > > Here are the software versions I am using > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > 8.0.6/Mar 26 2004 > PeopleSoft: 8.8 > Oracle: 9i > > I came across a script that transfers file from UNIX to NT i.e After > the SQR runs on UNIX > it transfers to NT. > The code that I came across is as follows: > I write the script in a file, execute it using the move-files > procedure > > begin-procedure write-sh-file > let $file-path = 'cd /home/out/payroll' > let $L1 = 'HOST=' || '''x.x.x.x''' > let $L2 = 'USER=' || '''usename''' > let $L3 = 'PASSWD=' || '''pwd''' > let $L4 = 'echo ' || '"remote Login attempted"' > let $L5 = 'ftp -n $HOST < let $L6 = 'quote USER $USER' > let $L7 = 'quote PASS $PASSWD' > let $L8 = 'cd /GL/Reports' > let $L9 = 'prompt' > let $L10 = 'put ' || $filename1 > let $L11 = 'END_SCRIPT' > let $L12 = 'FTP_RETURN_CODE=$?' > let $L13 = 'if [ $FTP_RETURN_CODE = 0 ]; then' > let $L14 = 'echo ' || '"Transfered Successful, deleting > source files"' > let $L15 = 'cd /home/out/payroll' > let $L16 = 'delete ' || $filename1 > let $L17 = 'exit 0' > let $L18 = 'else' > let $L19 = 'echo' || '"Transfered failed"' > let $L20 = 'exit 1' > let $L21 = 'fi' > > > write 2 from $file-path > write 2 from $L1 > ----- > ----- > > End-procedure > > In the above procedure : > $filename1 = $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > || '.csv' > > !----------------------------------------------------------------------- > !Procedure : move-files > !Called By : wrap-up > !----------------------------------------------------------------------- > begin-procedure move-files > let $path = '/export/home/psadmin/scripts/' > let $file = 'sh ' || $path || 'cbgl0007.sh' > > call system using $file #status3 > > if #status3 <> 0 > display ' call status: ' noline > display #status3 > end-if > if #status3 = 0 > display 'Unix script Executed' > end-if > > End-Procedure > > Now I need a similar or any script, that when the SQR is run on NT > and > after it creates an > output file in a specific folder in DEV, it should get transferred > to > a folder in TST > or vice versa. > Pls let me know > > Thanks > Raghav > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users ----------------------------------------- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sat Apr 23 06:55:33 2005 Date: Sat, 23 Apr 2005 04:54:45 -0700 (PDT) From: "Satheesh M.S" Subject: [sqr-users] (no subject) is there any downloadable third party tool which can convert .sqr or .sqt files into .srm files Satheesh M.S Maximo Administrator GAC Abu Dhabi UAE __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sat Apr 23 10:50:38 2005 From: Ray Ontko Date: Sat, 23 Apr 2005 10:50:08 -0500 Subject: Re: [sqr-users] (no subject) None that I'm aware of. Ray On Sat, Apr 23, 2005 at 04:54:45AM -0700, Satheesh M.S wrote: > is there any downloadable third party tool which can convert .sqr or .sqt files into .srm files > > > Satheesh M.S > Maximo Administrator > GAC > Abu Dhabi > UAE > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users ---------------------------------------------------------------------- Ray Ontko rayo@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun Apr 24 23:10:00 2005 Date: Sun, 24 Apr 2005 21:08:53 -0700 From: Raghvendra Dharwada Subject: [sqr-users] Re: Transferring output file within environments using SQR when the SQR Report is run on NT (Dattatraya Shetty) Hi Datta, Thank you very much for the reply regarding the transfer of files. I will try as per your suggestion Raghav On 4/23/05, sqr-users-request@sqrug.org wrote: > Send sqr-users mailing list submissions to > sqr-users@sqrug.org >=20 > To subscribe or unsubscribe via the World Wide Web, visit > http://www.sqrug.org/mailman/listinfo/sqr-users > or, via email, send a message with subject or body 'help' to > sqr-users-request@sqrug.org >=20 > You can reach the person managing the list at > sqr-users-owner@sqrug.org >=20 > When replying, please edit your Subject line so it is more specific > than "Re: Contents of sqr-users digest..." >=20 >=20 > Today's Topics: >=20 > 1. Re: Transferring output file within environments using SQR > when the SQR Report is run on NT (Dattatraya Shetty) > 2. RE: Transferring output file within environments usin g SQR > when the SQR Report is run on NT (jeff_molloy@adp.com) >=20 >=20 >=20 > ---------- Forwarded message ---------- > From: Dattatraya Shetty > To: "This list is for discussion about the SQR database reporting languag= e from Hyperion Solutions." > Date: Fri, 22 Apr 2005 06:13:26 -0700 (PDT) > Subject: Re: [sqr-users] Transferring output file within environments usi= ng SQR when the SQR Report is run on NT > Hi Raghav, > This might be fairly simple if you can create a share for the TST > box and create a mapping on the machine where the SQR is running. >=20 > e.g > map Z: =3D \\TSTSERVER\sharedrive. >=20 > Once you have this you can simply execute a copy command using the > system call to copy the file that might be the quickest of all options. >=20 > let $cmd =3D 'copy \\DEVSERVER\filename Z:\filename' >=20 > call system using $cmd status=3D#stat >=20 > ! check the return status. >=20 > if not you may have to do an ftp. like in the script below, make sure > there is an ftp program available on the NT box and try to manually ftp > to the TST box from DEV and then you can use the script below with > changes to hostname userid and password. etc >=20 > HTH > Datta. > --- Raghvendra Dharwada wrote: > > Hi all, > > Can anyone help me how to write a script in an SQR program that can > > transfer (copy) a file from one environment to another (say DEV to > > TST) (network folders) in Windows NT ? > > > > The scenario is like this: > > > > The SQR is run on NT. > > It creates an output file in DEV (in some folder) > > This file should be transferred to TST (in some folder) > > > > Here are the software versions I am using > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > 8.0.6/Mar 26 2004 > > PeopleSoft: 8.8 > > Oracle: 9i > > > > I came across a script that transfers file from UNIX to NT i.e After > > the SQR runs on UNIX > > it transfers to NT. > > The code that I came across is as follows: > > I write the script in a file, execute it using the move-files > > procedure > > > > begin-procedure write-sh-file > > let $file-path =3D 'cd /home/out/payroll' > > let $L1 =3D 'HOST=3D' || '''x.x.x.x''' > > let $L2 =3D 'USER=3D' || '''usename''' > > let $L3 =3D 'PASSWD=3D' || '''pwd''' > > let $L4 =3D 'echo ' || '"remote Login attempted"' > > let $L5 =3D 'ftp -n $HOST < > let $L6 =3D 'quote USER $USER' > > let $L7 =3D 'quote PASS $PASSWD' > > let $L8 =3D 'cd /GL/Reports' > > let $L9 =3D 'prompt' > > let $L10 =3D 'put ' || $filename1 > > let $L11 =3D 'END_SCRIPT' > > let $L12 =3D 'FTP_RETURN_CODE=3D$?' > > let $L13 =3D 'if [ $FTP_RETURN_CODE =3D 0 ]; then' > > let $L14 =3D 'echo ' || '"Transfered Successful, deleting > > source files"' > > let $L15 =3D 'cd /home/out/payroll' > > let $L16 =3D 'delete ' || $filename1 > > let $L17 =3D 'exit 0' > > let $L18 =3D 'else' > > let $L19 =3D 'echo' || '"Transfered failed"' > > let $L20 =3D 'exit 1' > > let $L21 =3D 'fi' > > > > > > write 2 from $file-path > > write 2 from $L1 > > ----- > > ----- > > > > End-procedure > > > > In the above procedure : > > $filename1 =3D $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > || '.csv' > > > > > !----------------------------------------------------------------------- > > !Procedure : move-files > > !Called By : wrap-up > > > !----------------------------------------------------------------------- > > begin-procedure move-files > > let $path =3D '/export/home/psadmin/scripts/' > > let $file =3D 'sh ' || $path || 'cbgl0007.sh' > > > > call system using $file #status3 > > > > if #status3 <> 0 > > display ' call status: ' noline > > display #status3 > > end-if > > if #status3 =3D 0 > > display 'Unix script Executed' > > end-if > > > > End-Procedure > > > > Now I need a similar or any script, that when the SQR is run on NT > > and > > after it creates an > > output file in a specific folder in DEV, it should get transferred > > to > > a folder in TST > > or vice versa. > > Pls let me know > > > > Thanks > > Raghav > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >=20 >=20 >=20 > ---------- Forwarded message ---------- > From: jeff_molloy@adp.com > To: sqr-users@sqrug.org > Date: Fri, 22 Apr 2005 09:32:37 -0400 > Subject: RE: [sqr-users] Transferring output file within environments usi= n g SQR when the SQR Report is run on NT > Also, if you do not want to map the drive, just put the > \\TSTSERVER\sharedrive in double quotes. That will work also. >=20 > "\\TSTSERVER\sharedrive" >=20 > Jeff Molloy >=20 > -----Original Message----- > From: Dattatraya Shetty [mailto:datta_shetty@yahoo.com] > Sent: Friday, April 22, 2005 9:13 AM > To: This list is for discussion about the SQR database reporting language > from Hyperion Solutions. > Subject: Re: [sqr-users] Transferring output file within environments usi= ng > SQR when the SQR Report is run on NT >=20 > Hi Raghav, > This might be fairly simple if you can create a share for the TST > box and create a mapping on the machine where the SQR is running. >=20 > e.g > map Z: =3D \\TSTSERVER\sharedrive. >=20 > Once you have this you can simply execute a copy command using the > system call to copy the file that might be the quickest of all options. >=20 > let $cmd =3D 'copy \\DEVSERVER\filename Z:\filename' >=20 > call system using $cmd status=3D#stat >=20 > ! check the return status. >=20 > if not you may have to do an ftp. like in the script below, make sure > there is an ftp program available on the NT box and try to manually ftp > to the TST box from DEV and then you can use the script below with > changes to hostname userid and password. etc >=20 > HTH > Datta. > --- Raghvendra Dharwada wrote: > > Hi all, > > Can anyone help me how to write a script in an SQR program that can > > transfer (copy) a file from one environment to another (say DEV to > > TST) (network folders) in Windows NT ? > > > > The scenario is like this: > > > > The SQR is run on NT. > > It creates an output file in DEV (in some folder) > > This file should be transferred to TST (in some folder) > > > > Here are the software versions I am using > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > 8.0.6/Mar 26 2004 > > PeopleSoft: 8.8 > > Oracle: 9i > > > > I came across a script that transfers file from UNIX to NT i.e After > > the SQR runs on UNIX > > it transfers to NT. > > The code that I came across is as follows: > > I write the script in a file, execute it using the move-files > > procedure > > > > begin-procedure write-sh-file > > let $file-path =3D 'cd /home/out/payroll' > > let $L1 =3D 'HOST=3D' || '''x.x.x.x''' > > let $L2 =3D 'USER=3D' || '''usename''' > > let $L3 =3D 'PASSWD=3D' || '''pwd''' > > let $L4 =3D 'echo ' || '"remote Login attempted"' > > let $L5 =3D 'ftp -n $HOST < > let $L6 =3D 'quote USER $USER' > > let $L7 =3D 'quote PASS $PASSWD' > > let $L8 =3D 'cd /GL/Reports' > > let $L9 =3D 'prompt' > > let $L10 =3D 'put ' || $filename1 > > let $L11 =3D 'END_SCRIPT' > > let $L12 =3D 'FTP_RETURN_CODE=3D$?' > > let $L13 =3D 'if [ $FTP_RETURN_CODE =3D 0 ]; then' > > let $L14 =3D 'echo ' || '"Transfered Successful, deleting > > source files"' > > let $L15 =3D 'cd /home/out/payroll' > > let $L16 =3D 'delete ' || $filename1 > > let $L17 =3D 'exit 0' > > let $L18 =3D 'else' > > let $L19 =3D 'echo' || '"Transfered failed"' > > let $L20 =3D 'exit 1' > > let $L21 =3D 'fi' > > > > > > write 2 from $file-path > > write 2 from $L1 > > ----- > > ----- > > > > End-procedure > > > > In the above procedure : > > $filename1 =3D $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > || '.csv' > > > > > !----------------------------------------------------------------------- > > !Procedure : move-files > > !Called By : wrap-up > > > !----------------------------------------------------------------------- > > begin-procedure move-files > > let $path =3D '/export/home/psadmin/scripts/' > > let $file =3D 'sh ' || $path || 'cbgl0007.sh' > > > > call system using $file #status3 > > > > if #status3 <> 0 > > display ' call status: ' noline > > display #status3 > > end-if > > if #status3 =3D 0 > > display 'Unix script Executed' > > end-if > > > > End-Procedure > > > > Now I need a similar or any script, that when the SQR is run on NT > > and > > after it creates an > > output file in a specific folder in DEV, it should get transferred > > to > > a folder in TST > > or vice versa. > > Pls let me know > > > > Thanks > > Raghav > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >=20 > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users >=20 > ----------------------------------------- > This message and any attachments are intended only for the use of the > addressee and may contain information that is privileged and confidential. > If the reader of the message is not the intended recipient or an authoriz= ed > representative of the intended recipient, you are hereby notified that any > dissemination of this communication is strictly prohibited. If you have > received this communication in error, notify the sender immediately by > return email and delete the message and any attachments from your system. >=20 >=20 > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users >=20 >=20 > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 25 17:26:56 2005 Date: Mon, 25 Apr 2005 15:25:40 -0700 From: Raghvendra Dharwada Subject: [sqr-users] Issue with the FTP script in deleting files in UNIX Hi Datta, I have one more problem with the ftp script (UNIX). After the output file is created and transferred to NT, the file should get deleted in UNIX as per the script ($L16). But for some reason this delete isnt working. Can you=20 suggest me what I can do? here is the script: let $file-path =3D 'cd /d01/psadmin/out/payroll'=20=20 let $L1 =3D 'HOST=3D' || '''172.21.1.109''' let $L2 =3D 'USER=3D' || '''psadmin''' let $L3 =3D 'PASSWD=3D' || '''psadmin''' let $L4 =3D 'echo ' || '"remote Login attempted"' let $L5 =3D 'ftp -n $HOST < wrote: > Send sqr-users mailing list submissions to > sqr-users@sqrug.org >=20 > To subscribe or unsubscribe via the World Wide Web, visit > http://www.sqrug.org/mailman/listinfo/sqr-users > or, via email, send a message with subject or body 'help' to > sqr-users-request@sqrug.org >=20 > You can reach the person managing the list at > sqr-users-owner@sqrug.org >=20 > When replying, please edit your Subject line so it is more specific > than "Re: Contents of sqr-users digest..." >=20 >=20 > Today's Topics: >=20 > 1. Re: Transferring output file within environments using SQR > when the SQR Report is run on NT (Dattatraya Shetty) > (Raghvendra Dharwada) >=20 >=20 >=20 > ---------- Forwarded message ---------- > From: Raghvendra Dharwada > To: sqr-users@sqrug.org > Date: Sun, 24 Apr 2005 21:08:53 -0700 > Subject: [sqr-users] Re: Transferring output file within environments usi= ng SQR when the SQR Report is run on NT (Dattatraya Shetty) > Hi Datta, >=20 > Thank you very much for the reply regarding the transfer of files. I > will try as per your suggestion >=20 > Raghav >=20 > On 4/23/05, sqr-users-request@sqrug.org wro= te: > > Send sqr-users mailing list submissions to > > sqr-users@sqrug.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://www.sqrug.org/mailman/listinfo/sqr-users > > or, via email, send a message with subject or body 'help' to > > sqr-users-request@sqrug.org > > > > You can reach the person managing the list at > > sqr-users-owner@sqrug.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of sqr-users digest..." > > > > > > Today's Topics: > > > > 1. Re: Transferring output file within environments using SQR > > when the SQR Report is run on NT (Dattatraya Shetty) > > 2. RE: Transferring output file within environments usin g SQR > > when the SQR Report is run on NT (jeff_molloy@adp.com) > > > > > > > > ---------- Forwarded message ---------- > > From: Dattatraya Shetty > > To: "This list is for discussion about the SQR database reporting langu= age from Hyperion Solutions." > > Date: Fri, 22 Apr 2005 06:13:26 -0700 (PDT) > > Subject: Re: [sqr-users] Transferring output file within environments u= sing SQR when the SQR Report is run on NT > > Hi Raghav, > > This might be fairly simple if you can create a share for the TST > > box and create a mapping on the machine where the SQR is running. > > > > e.g > > map Z: =3D \\TSTSERVER\sharedrive. > > > > Once you have this you can simply execute a copy command using the > > system call to copy the file that might be the quickest of all options. > > > > let $cmd =3D 'copy \\DEVSERVER\filename Z:\filename' > > > > call system using $cmd status=3D#stat > > > > ! check the return status. > > > > if not you may have to do an ftp. like in the script below, make sure > > there is an ftp program available on the NT box and try to manually ftp > > to the TST box from DEV and then you can use the script below with > > changes to hostname userid and password. etc > > > > HTH > > Datta. > > --- Raghvendra Dharwada wrote: > > > Hi all, > > > Can anyone help me how to write a script in an SQR program that can > > > transfer (copy) a file from one environment to another (say DEV to > > > TST) (network folders) in Windows NT ? > > > > > > The scenario is like this: > > > > > > The SQR is run on NT. > > > It creates an output file in DEV (in some folder) > > > This file should be transferred to TST (in some folder) > > > > > > Here are the software versions I am using > > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > > 8.0.6/Mar 26 2004 > > > PeopleSoft: 8.8 > > > Oracle: 9i > > > > > > I came across a script that transfers file from UNIX to NT i.e After > > > the SQR runs on UNIX > > > it transfers to NT. > > > The code that I came across is as follows: > > > I write the script in a file, execute it using the move-files > > > procedure > > > > > > begin-procedure write-sh-file > > > let $file-path =3D 'cd /home/out/payroll' > > > let $L1 =3D 'HOST=3D' || '''x.x.x.x''' > > > let $L2 =3D 'USER=3D' || '''usename''' > > > let $L3 =3D 'PASSWD=3D' || '''pwd''' > > > let $L4 =3D 'echo ' || '"remote Login attempted"' > > > let $L5 =3D 'ftp -n $HOST < > > let $L6 =3D 'quote USER $USER' > > > let $L7 =3D 'quote PASS $PASSWD' > > > let $L8 =3D 'cd /GL/Reports' > > > let $L9 =3D 'prompt' > > > let $L10 =3D 'put ' || $filename1 > > > let $L11 =3D 'END_SCRIPT' > > > let $L12 =3D 'FTP_RETURN_CODE=3D$?' > > > let $L13 =3D 'if [ $FTP_RETURN_CODE =3D 0 ]; then' > > > let $L14 =3D 'echo ' || '"Transfered Successful, deleting > > > source files"' > > > let $L15 =3D 'cd /home/out/payroll' > > > let $L16 =3D 'delete ' || $filename1 > > > let $L17 =3D 'exit 0' > > > let $L18 =3D 'else' > > > let $L19 =3D 'echo' || '"Transfered failed"' > > > let $L20 =3D 'exit 1' > > > let $L21 =3D 'fi' > > > > > > > > > write 2 from $file-path > > > write 2 from $L1 > > > ----- > > > ----- > > > > > > End-procedure > > > > > > In the above procedure : > > > $filename1 =3D $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > > || '.csv' > > > > > > > > !----------------------------------------------------------------------- > > > !Procedure : move-files > > > !Called By : wrap-up > > > > > !----------------------------------------------------------------------- > > > begin-procedure move-files > > > let $path =3D '/export/home/psadmin/scripts/' > > > let $file =3D 'sh ' || $path || 'cbgl0007.sh' > > > > > > call system using $file #status3 > > > > > > if #status3 <> 0 > > > display ' call status: ' noline > > > display #status3 > > > end-if > > > if #status3 =3D 0 > > > display 'Unix script Executed' > > > end-if > > > > > > End-Procedure > > > > > > Now I need a similar or any script, that when the SQR is run on NT > > > and > > > after it creates an > > > output file in a specific folder in DEV, it should get transferred > > > to > > > a folder in TST > > > or vice versa. > > > Pls let me know > > > > > > Thanks > > > Raghav > > > > > > _______________________________________________ > > > sqr-users mailing list > > > sqr-users@sqrug.org > > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > > > > > ---------- Forwarded message ---------- > > From: jeff_molloy@adp.com > > To: sqr-users@sqrug.org > > Date: Fri, 22 Apr 2005 09:32:37 -0400 > > Subject: RE: [sqr-users] Transferring output file within environments u= sin g SQR when the SQR Report is run on NT > > Also, if you do not want to map the drive, just put the > > \\TSTSERVER\sharedrive in double quotes. That will work also. > > > > "\\TSTSERVER\sharedrive" > > > > Jeff Molloy > > > > -----Original Message----- > > From: Dattatraya Shetty [mailto:datta_shetty@yahoo.com] > > Sent: Friday, April 22, 2005 9:13 AM > > To: This list is for discussion about the SQR database reporting langua= ge > > from Hyperion Solutions. > > Subject: Re: [sqr-users] Transferring output file within environments u= sing > > SQR when the SQR Report is run on NT > > > > Hi Raghav, > > This might be fairly simple if you can create a share for the TST > > box and create a mapping on the machine where the SQR is running. > > > > e.g > > map Z: =3D \\TSTSERVER\sharedrive. > > > > Once you have this you can simply execute a copy command using the > > system call to copy the file that might be the quickest of all options. > > > > let $cmd =3D 'copy \\DEVSERVER\filename Z:\filename' > > > > call system using $cmd status=3D#stat > > > > ! check the return status. > > > > if not you may have to do an ftp. like in the script below, make sure > > there is an ftp program available on the NT box and try to manually ftp > > to the TST box from DEV and then you can use the script below with > > changes to hostname userid and password. etc > > > > HTH > > Datta. > > --- Raghvendra Dharwada wrote: > > > Hi all, > > > Can anyone help me how to write a script in an SQR program that can > > > transfer (copy) a file from one environment to another (say DEV to > > > TST) (network folders) in Windows NT ? > > > > > > The scenario is like this: > > > > > > The SQR is run on NT. > > > It creates an output file in DEV (in some folder) > > > This file should be transferred to TST (in some folder) > > > > > > Here are the software versions I am using > > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > > 8.0.6/Mar 26 2004 > > > PeopleSoft: 8.8 > > > Oracle: 9i > > > > > > I came across a script that transfers file from UNIX to NT i.e After > > > the SQR runs on UNIX > > > it transfers to NT. > > > The code that I came across is as follows: > > > I write the script in a file, execute it using the move-files > > > procedure > > > > > > begin-procedure write-sh-file > > > let $file-path =3D 'cd /home/out/payroll' > > > let $L1 =3D 'HOST=3D' || '''x.x.x.x''' > > > let $L2 =3D 'USER=3D' || '''usename''' > > > let $L3 =3D 'PASSWD=3D' || '''pwd''' > > > let $L4 =3D 'echo ' || '"remote Login attempted"' > > > let $L5 =3D 'ftp -n $HOST < > > let $L6 =3D 'quote USER $USER' > > > let $L7 =3D 'quote PASS $PASSWD' > > > let $L8 =3D 'cd /GL/Reports' > > > let $L9 =3D 'prompt' > > > let $L10 =3D 'put ' || $filename1 > > > let $L11 =3D 'END_SCRIPT' > > > let $L12 =3D 'FTP_RETURN_CODE=3D$?' > > > let $L13 =3D 'if [ $FTP_RETURN_CODE =3D 0 ]; then' > > > let $L14 =3D 'echo ' || '"Transfered Successful, deleting > > > source files"' > > > let $L15 =3D 'cd /home/out/payroll' > > > let $L16 =3D 'delete ' || $filename1 > > > let $L17 =3D 'exit 0' > > > let $L18 =3D 'else' > > > let $L19 =3D 'echo' || '"Transfered failed"' > > > let $L20 =3D 'exit 1' > > > let $L21 =3D 'fi' > > > > > > > > > write 2 from $file-path > > > write 2 from $L1 > > > ----- > > > ----- > > > > > > End-procedure > > > > > > In the above procedure : > > > $filename1 =3D $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > > || '.csv' > > > > > > > > !----------------------------------------------------------------------- > > > !Procedure : move-files > > > !Called By : wrap-up > > > > > !----------------------------------------------------------------------- > > > begin-procedure move-files > > > let $path =3D '/export/home/psadmin/scripts/' > > > let $file =3D 'sh ' || $path || 'cbgl0007.sh' > > > > > > call system using $file #status3 > > > > > > if #status3 <> 0 > > > display ' call status: ' noline > > > display #status3 > > > end-if > > > if #status3 =3D 0 > > > display 'Unix script Executed' > > > end-if > > > > > > End-Procedure > > > > > > Now I need a similar or any script, that when the SQR is run on NT > > > and > > > after it creates an > > > output file in a specific folder in DEV, it should get transferred > > > to > > > a folder in TST > > > or vice versa. > > > Pls let me know > > > > > > Thanks > > > Raghav > > > > > > _______________________________________________ > > > sqr-users mailing list > > > sqr-users@sqrug.org > > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > ----------------------------------------- > > This message and any attachments are intended only for the use of the > > addressee and may contain information that is privileged and confidenti= al. > > If the reader of the message is not the intended recipient or an author= ized > > representative of the intended recipient, you are hereby notified that = any > > dissemination of this communication is strictly prohibited. If you have > > received this communication in error, notify the sender immediately by > > return email and delete the message and any attachments from your syste= m. > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > >=20 >=20 > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users >=20 >=20 > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon Apr 25 17:35:28 2005 From: Bob Stone Subject: RE: [sqr-users] Issue with the FTP script in deleting files in UN IX Date: Mon, 25 Apr 2005 17:34:20 -0500 in UNIX you dont 'delete' you 'rm' (remove). let $L16 = 'rm ' || $Dept_Id || '_' || 'cbgl0008_' || $prcs_process_instance || '.csv' -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Raghvendra Dharwada Sent: Monday, April 25, 2005 5:26 PM To: sqr-users@sqrug.org Subject: [sqr-users] Issue with the FTP script in deleting files in UNIX Hi Datta, I have one more problem with the ftp script (UNIX). After the output file is created and transferred to NT, the file should get deleted in UNIX as per the script ($L16). But for some reason this delete isnt working. Can you suggest me what I can do? here is the script: let $file-path = 'cd /d01/psadmin/out/payroll' let $L1 = 'HOST=' || '''172.21.1.109''' let $L2 = 'USER=' || '''psadmin''' let $L3 = 'PASSWD=' || '''psadmin''' let $L4 = 'echo ' || '"remote Login attempted"' let $L5 = 'ftp -n $HOST < wrote: > Send sqr-users mailing list submissions to > sqr-users@sqrug.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.sqrug.org/mailman/listinfo/sqr-users > or, via email, send a message with subject or body 'help' to > sqr-users-request@sqrug.org > > You can reach the person managing the list at > sqr-users-owner@sqrug.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of sqr-users digest..." > > > Today's Topics: > > 1. Re: Transferring output file within environments using SQR > when the SQR Report is run on NT (Dattatraya Shetty) > (Raghvendra Dharwada) > > > > ---------- Forwarded message ---------- > From: Raghvendra Dharwada > To: sqr-users@sqrug.org > Date: Sun, 24 Apr 2005 21:08:53 -0700 > Subject: [sqr-users] Re: Transferring output file within environments using SQR when the SQR Report is run on NT (Dattatraya Shetty) > Hi Datta, > > Thank you very much for the reply regarding the transfer of files. I > will try as per your suggestion > > Raghav > > On 4/23/05, sqr-users-request@sqrug.org wrote: > > Send sqr-users mailing list submissions to > > sqr-users@sqrug.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://www.sqrug.org/mailman/listinfo/sqr-users > > or, via email, send a message with subject or body 'help' to > > sqr-users-request@sqrug.org > > > > You can reach the person managing the list at > > sqr-users-owner@sqrug.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of sqr-users digest..." > > > > > > Today's Topics: > > > > 1. Re: Transferring output file within environments using SQR > > when the SQR Report is run on NT (Dattatraya Shetty) > > 2. RE: Transferring output file within environments usin g SQR > > when the SQR Report is run on NT (jeff_molloy@adp.com) > > > > > > > > ---------- Forwarded message ---------- > > From: Dattatraya Shetty > > To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." > > Date: Fri, 22 Apr 2005 06:13:26 -0700 (PDT) > > Subject: Re: [sqr-users] Transferring output file within environments using SQR when the SQR Report is run on NT > > Hi Raghav, > > This might be fairly simple if you can create a share for the TST > > box and create a mapping on the machine where the SQR is running. > > > > e.g > > map Z: = \\TSTSERVER\sharedrive. > > > > Once you have this you can simply execute a copy command using the > > system call to copy the file that might be the quickest of all options. > > > > let $cmd = 'copy \\DEVSERVER\filename Z:\filename' > > > > call system using $cmd status=#stat > > > > ! check the return status. > > > > if not you may have to do an ftp. like in the script below, make sure > > there is an ftp program available on the NT box and try to manually ftp > > to the TST box from DEV and then you can use the script below with > > changes to hostname userid and password. etc > > > > HTH > > Datta. > > --- Raghvendra Dharwada wrote: > > > Hi all, > > > Can anyone help me how to write a script in an SQR program that can > > > transfer (copy) a file from one environment to another (say DEV to > > > TST) (network folders) in Windows NT ? > > > > > > The scenario is like this: > > > > > > The SQR is run on NT. > > > It creates an output file in DEV (in some folder) > > > This file should be transferred to TST (in some folder) > > > > > > Here are the software versions I am using > > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > > 8.0.6/Mar 26 2004 > > > PeopleSoft: 8.8 > > > Oracle: 9i > > > > > > I came across a script that transfers file from UNIX to NT i.e After > > > the SQR runs on UNIX > > > it transfers to NT. > > > The code that I came across is as follows: > > > I write the script in a file, execute it using the move-files > > > procedure > > > > > > begin-procedure write-sh-file > > > let $file-path = 'cd /home/out/payroll' > > > let $L1 = 'HOST=' || '''x.x.x.x''' > > > let $L2 = 'USER=' || '''usename''' > > > let $L3 = 'PASSWD=' || '''pwd''' > > > let $L4 = 'echo ' || '"remote Login attempted"' > > > let $L5 = 'ftp -n $HOST < > > let $L6 = 'quote USER $USER' > > > let $L7 = 'quote PASS $PASSWD' > > > let $L8 = 'cd /GL/Reports' > > > let $L9 = 'prompt' > > > let $L10 = 'put ' || $filename1 > > > let $L11 = 'END_SCRIPT' > > > let $L12 = 'FTP_RETURN_CODE=$?' > > > let $L13 = 'if [ $FTP_RETURN_CODE = 0 ]; then' > > > let $L14 = 'echo ' || '"Transfered Successful, deleting > > > source files"' > > > let $L15 = 'cd /home/out/payroll' > > > let $L16 = 'delete ' || $filename1 > > > let $L17 = 'exit 0' > > > let $L18 = 'else' > > > let $L19 = 'echo' || '"Transfered failed"' > > > let $L20 = 'exit 1' > > > let $L21 = 'fi' > > > > > > > > > write 2 from $file-path > > > write 2 from $L1 > > > ----- > > > ----- > > > > > > End-procedure > > > > > > In the above procedure : > > > $filename1 = $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > > || '.csv' > > > > > > > > !----------------------------------------------------------------------- > > > !Procedure : move-files > > > !Called By : wrap-up > > > > > !----------------------------------------------------------------------- > > > begin-procedure move-files > > > let $path = '/export/home/psadmin/scripts/' > > > let $file = 'sh ' || $path || 'cbgl0007.sh' > > > > > > call system using $file #status3 > > > > > > if #status3 <> 0 > > > display ' call status: ' noline > > > display #status3 > > > end-if > > > if #status3 = 0 > > > display 'Unix script Executed' > > > end-if > > > > > > End-Procedure > > > > > > Now I need a similar or any script, that when the SQR is run on NT > > > and > > > after it creates an > > > output file in a specific folder in DEV, it should get transferred > > > to > > > a folder in TST > > > or vice versa. > > > Pls let me know > > > > > > Thanks > > > Raghav > > > > > > _______________________________________________ > > > sqr-users mailing list > > > sqr-users@sqrug.org > > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > > > > > ---------- Forwarded message ---------- > > From: jeff_molloy@adp.com > > To: sqr-users@sqrug.org > > Date: Fri, 22 Apr 2005 09:32:37 -0400 > > Subject: RE: [sqr-users] Transferring output file within environments usin g SQR when the SQR Report is run on NT > > Also, if you do not want to map the drive, just put the > > \\TSTSERVER\sharedrive in double quotes. That will work also. > > > > "\\TSTSERVER\sharedrive" > > > > Jeff Molloy > > > > -----Original Message----- > > From: Dattatraya Shetty [mailto:datta_shetty@yahoo.com] > > Sent: Friday, April 22, 2005 9:13 AM > > To: This list is for discussion about the SQR database reporting language > > from Hyperion Solutions. > > Subject: Re: [sqr-users] Transferring output file within environments using > > SQR when the SQR Report is run on NT > > > > Hi Raghav, > > This might be fairly simple if you can create a share for the TST > > box and create a mapping on the machine where the SQR is running. > > > > e.g > > map Z: = \\TSTSERVER\sharedrive. > > > > Once you have this you can simply execute a copy command using the > > system call to copy the file that might be the quickest of all options. > > > > let $cmd = 'copy \\DEVSERVER\filename Z:\filename' > > > > call system using $cmd status=#stat > > > > ! check the return status. > > > > if not you may have to do an ftp. like in the script below, make sure > > there is an ftp program available on the NT box and try to manually ftp > > to the TST box from DEV and then you can use the script below with > > changes to hostname userid and password. etc > > > > HTH > > Datta. > > --- Raghvendra Dharwada wrote: > > > Hi all, > > > Can anyone help me how to write a script in an SQR program that can > > > transfer (copy) a file from one environment to another (say DEV to > > > TST) (network folders) in Windows NT ? > > > > > > The scenario is like this: > > > > > > The SQR is run on NT. > > > It creates an output file in DEV (in some folder) > > > This file should be transferred to TST (in some folder) > > > > > > Here are the software versions I am using > > > $sqr-ver: SQR for PeopleSoft/8.44.08 /Sun/SunOS 5.6/Oracle > > > 8.0.6/Mar 26 2004 > > > PeopleSoft: 8.8 > > > Oracle: 9i > > > > > > I came across a script that transfers file from UNIX to NT i.e After > > > the SQR runs on UNIX > > > it transfers to NT. > > > The code that I came across is as follows: > > > I write the script in a file, execute it using the move-files > > > procedure > > > > > > begin-procedure write-sh-file > > > let $file-path = 'cd /home/out/payroll' > > > let $L1 = 'HOST=' || '''x.x.x.x''' > > > let $L2 = 'USER=' || '''usename''' > > > let $L3 = 'PASSWD=' || '''pwd''' > > > let $L4 = 'echo ' || '"remote Login attempted"' > > > let $L5 = 'ftp -n $HOST < > > let $L6 = 'quote USER $USER' > > > let $L7 = 'quote PASS $PASSWD' > > > let $L8 = 'cd /GL/Reports' > > > let $L9 = 'prompt' > > > let $L10 = 'put ' || $filename1 > > > let $L11 = 'END_SCRIPT' > > > let $L12 = 'FTP_RETURN_CODE=$?' > > > let $L13 = 'if [ $FTP_RETURN_CODE = 0 ]; then' > > > let $L14 = 'echo ' || '"Transfered Successful, deleting > > > source files"' > > > let $L15 = 'cd /home/out/payroll' > > > let $L16 = 'delete ' || $filename1 > > > let $L17 = 'exit 0' > > > let $L18 = 'else' > > > let $L19 = 'echo' || '"Transfered failed"' > > > let $L20 = 'exit 1' > > > let $L21 = 'fi' > > > > > > > > > write 2 from $file-path > > > write 2 from $L1 > > > ----- > > > ----- > > > > > > End-procedure > > > > > > In the above procedure : > > > $filename1 = $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance > > > || '.csv' > > > > > > > > !----------------------------------------------------------------------- > > > !Procedure : move-files > > > !Called By : wrap-up > > > > > !----------------------------------------------------------------------- > > > begin-procedure move-files > > > let $path = '/export/home/psadmin/scripts/' > > > let $file = 'sh ' || $path || 'cbgl0007.sh' > > > > > > call system using $file #status3 > > > > > > if #status3 <> 0 > > > display ' call status: ' noline > > > display #status3 > > > end-if > > > if #status3 = 0 > > > display 'Unix script Executed' > > > end-if > > > > > > End-Procedure > > > > > > Now I need a similar or any script, that when the SQR is run on NT > > > and > > > after it creates an > > > output file in a specific folder in DEV, it should get transferred > > > to > > > a folder in TST > > > or vice versa. > > > Pls let me know > > > > > > Thanks > > > Raghav > > > > > > _______________________________________________ > > > sqr-users mailing list > > > sqr-users@sqrug.org > > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > ----------------------------------------- > > This message and any attachments are intended only for the use of the > > addressee and may contain information that is privileged and confidential. > > If the reader of the message is not the intended recipient or an authorized > > representative of the intended recipient, you are hereby notified that any > > dissemination of this communication is strictly prohibited. If you have > > received this communication in error, notify the sender immediately by > > return email and delete the message and any attachments from your system. > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > > > > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > > _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 27 11:02:34 2005 From: "radhika reddy" Date: Wed, 27 Apr 2005 11:01:31 -0500 Subject: [sqr-users] SQR output Hi, Does anybody know whether SQR can create a word document as output? Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 27 14:02:15 2005 Date: Wed, 27 Apr 2005 12:01:10 -0700 (PDT) From: Clara Carter Subject: Re: [sqr-users] SQR output No it cannot. cc --- radhika reddy wrote: > Hi, > > Does anybody know whether SQR can create a word > document as output? > > Thanks. > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! > Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 27 14:40:46 2005 Subject: Re: [sqr-users] SQR output Date: Wed, 27 Apr 2005 19:40:09 -0000 From: Hi. You can launch Word with a SYSTEM call from SQR. Therefore you can create a file in SQR with say extension .txt and open Word on that file. If you know VBA you can also SENDKEYS to Word from SQR but the formatting tends not to be very good. John Willson Clara Carter said: > No it cannot. > > cc > --- radhika reddy wrote: > > Hi, > > > > Does anybody know whether SQR can create a word > > document as output? > > > > Thanks. > > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! > > Download today - it's FREE! > > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > > > _______________________________________________ > > sqr-users mailing list > > sqr-users@sqrug.org > > http://www.sqrug.org/mailman/listinfo/sqr-users > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > -- _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 27 14:58:58 2005 From: "John F. Connell Jr." Date: Wed, 27 Apr 2005 15:57:42 -0400 Subject: [sqr-users] SQR PDF To DOC or RTF I know this is a bit off topic however I'm looking to convert a PDF output file to doc or rtf file in sqr or by using a command line utility. Does anyone know or have experience using a PDF to doc or rtf command line utility that could perform this task? Regards, John John F. Connell Jr. JFC & Associates 53 Perch Pond Road Chatham, MA 02633 email - jfc.associates@comcast.net www - www.williamsconnell.com Phone - 1 (508) 945-4191 Fax - 1 (508) 945-1609 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed Apr 27 15:14:37 2005 Date: Wed, 27 Apr 2005 16:13:09 -0400 From: "Jamie Harris" Subject: Re: [sqr-users] SQR output If you have SQR create a text file with the .doc extension, it will open in Word. However, you can't have any formatting in the file (colors, font, etc.). I do a similar thing with Excel. A tab-delimited file named with .xls extension opens in Excel (.csv files do too - but I hate the .csv format - much more complex to deal with than tab delimited ;) ----------------------------------------------------- James Harris Junior Systems Programmer/Analyst Information Technology Division Frederick Community College ----------------------------------------------------- >>> radhika_05@hotmail.com 4/27/2005 12:01 PM >>> Hi, Does anybody know whether SQR can create a word document as output? Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 28 02:39:08 2005 From: "Steve Cavill" Subject: RE: [sqr-users] SQR output Date: Thu, 28 Apr 2005 17:37:44 +1000 If you can get a good reference you could write rtf output as a text file. Steve. -----Original Message----- From: sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org [mailto:sqr-users-bounces+steve.cavill=infoclarity.com.au@sqrug.org] On Behalf Of radhika reddy Sent: Thursday, 28 April 2005 2:02 AM To: sqr-users@sqrug.org Subject: [sqr-users] SQR output Hi, Does anybody know whether SQR can create a word document as output? Thanks. _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 28 08:16:06 2005 From: "radhika reddy" Subject: Re: [sqr-users] SQR output Date: Thu, 28 Apr 2005 08:15:02 -0500 Thanks for all the responses. Yes, I could create a Word doc as output by changing .txt file to .doc file in my sqr. Thanks. >From: "Jamie Harris" >Reply-To: "This list is for discussion about the SQR database >reportinglanguage from Hyperion Solutions." >To: >Subject: Re: [sqr-users] SQR output >Date: Wed, 27 Apr 2005 16:13:09 -0400 > > > >If you have SQR create a text file with the .doc extension, it will >open in Word. However, you can't have any formatting in the file >(colors, font, etc.). > >I do a similar thing with Excel. A tab-delimited file named with .xls >extension opens in Excel (.csv files do too - but I hate the .csv format >- much more complex to deal with than tab delimited ;) > > > >----------------------------------------------------- >James Harris >Junior Systems Programmer/Analyst >Information Technology Division >Frederick Community College >----------------------------------------------------- > > >>> radhika_05@hotmail.com 4/27/2005 12:01 PM >>> > >Hi, > > Does anybody know whether SQR can create a word document as >output? > >Thanks. > >_________________________________________________________________ >Express yourself instantly with MSN Messenger! Download today - it's >FREE! >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu Apr 28 09:48:29 2005 Date: Thu, 28 Apr 2005 10:47:17 -0400 From: "George Jansen" Subject: Re: [sqr-users] SQR output It seems to me that Word 2003 will import XML. That might be worth a try if= your customer has W2003. http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Fri Apr 29 15:50:38 2005 Date: Fri, 29 Apr 2005 13:49:33 -0700 (PDT) From: Joe Massian Subject: [sqr-users] PeopleSoft SQR, Calling PLSQL dynamically My question is, do you know how I can call a PL SQL package dynamically from a PeopleSoft run control table? I am entering the following into the RC table: LOAD_FS_ZZ_JRNL_LN3_TO_EPM.LOAD_JRNL_LN3 These are my return variables: ($ERROR, $MESSAGE, #SOURCE_COUNT, #TARGET_BEFORE_LOAD_COUNT, #TARGET_AFTER_LOAD_COUNT) My dynamic section looks like this so far.. Begin-SQL ! Begin ! [$EXECUTE_PACKAGE] ;; ! End;; ! End-SQL I build the $EXECUTE_PACKAGE using the following: Begin-Procedure Get-Input-Filename ! ! #ifdef debug Display 'Entered Get-Input-Filename Procedure.' ! #endif ! Begin-Select ! REPORT_NAME &REPORT_NAME FIELD2 &FIELD2 ! Let $Source_File = LTRIM(RTRIM(&REPORT_NAME, ' '),' ') ! Let $Source_File = LTRIM(RTRIM(&FIELD2, ' '),' ') Show '- Oracle PL/SQL package requested: ' &FIELD2 ! ! Build PL/SQL package call for Oracle... Let $EXECUTE_PACKAGE = &FIELD2 || '($ERROR, $MESSAGE, #SOURCE_COUNT, #TARGET_BEFORE_LOAD_COUNT, #TARGET_AFTER_LOAD_COUNT)' Show '- Oracle PL/SQL Package built: ' $EXECUTE_PACKAGE ! FROM PS_ZZ_PLSQL_RC_TBL ! WHERE OPRID = $PRCS_OPRID AND RUN_CNTL_ID = $PRCS_RUN_CNTL_ID ! End-Select ! ! #ifdef debug Display 'Exiting Get-Input-Filename Procedure.' ! endif ! End-Procedure Get-Input-Filename __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Sun May 01 00:00:39 2005 Date: Sun, 1 May 2005 00:00:03 -0500 From: Nathan Stratton Treadway Subject: [sqr-users] Monthly sqr-users Hints Posting sqr-users Mailing List Hints and Guidelines Nathan Stratton Treadway, Ray Ontko & Co. (nathanst@ontko.com) $Revision: 1.21 $ $Date: 2004-03-04 02:47:15-05 $ This document gathers in one location information about the sqr-users mail list. It includes instructions for changing your subscription settings (including unsubscribing), as well are guidelines for using the list. ______________________________________________________________________ Table of Contents 1. Changes Since Previous Version 2. Introduction 2.1 sqr-users Mailing List 2.2 sqr-users Hints and Guidelines Document 2.3 Related Mailing Lists 3. Interacting with the list server 3.1 Subscribing to the list 3.2 Unsubscribing from the list 3.3 When your email address changes 3.4 Digests 3.5 Obtaining your password 3.6 Problems 4. Posting to the sqr-users List 4.1 General Guidelines 4.2 Posting a Message 4.3 Replying to a Message 5. Job Announcements ______________________________________________________________________ 1. Changes Since Previous Version Changes since the version dated 2003/11/01: o Update subscribe/unsubscribe instructions for new version of list server software. o New URL for "brio-l" mailing list. 2. Introduction 2.1. sqr-users Mailing List The sqr-users mailing list was created to enable discussion related to the SQR database language from Hyperion (and to other products in the SQR product suite). Note: SQR used to be published by SQRIBE Technologies, which was merged into Brio Technology on August 3, 1999. Brio Technology changed its name to Brio Software in October 2001. On October 16, 2003, Hyperion acquired Brio Software. SQR and related applications have also been called "Brio.Report" and "Brio Reports". The mailing list is provided as a service of Ray Ontko & Co. A searchable archive of past postings to the mailing list is available from the SQR Users Group web site . 2.2. sqr-users Hints and Guidelines Document This document gives various hints and guidelines about the sqr-users mailing list. It will be posted approximately monthly to the mailing list so that new users can see it (and existing users can find it easily). An HTML version of the document is always available at http://www.sqrug.org/sqr-users/sqr-users-hints.html. If you have comments or suggestions about this document, please contact me directly at the address listed in the title section. This document is Copyright (C) 1999-2004 by Ray Ontko & Co. It may be freely copied and distributed provided it is not modified in any way and it retains the original copyright notice. 2.3. Related Mailing Lists Here are some mailing lists that cover topics relating to SQR in some way. sqr-jobs : SQR Jobs This list may be used for posting SQR-related resumes, recruitments, job announcements, project announcments, help- wanted, work-wanted ads, etc. To join, follow the link above, or send any message to "sqr-jobs-subscribe@yahoogroups.com". peoplesoft-fans : PeopleSoft Fans Moderated list covering technical and functional aspects of PeopleSoft. To join, follow the link above, or send any message to "peoplesoft-fans-subscribe@yahoogroups.com". psusers : PeopleSoft Users For questions related to any aspect of PeopleSoft (including PeopleSoft-specific SQR issues). This list has merged with the Peoplesoft Fans mailing list and is no longer active, but the message achive can still be found at the link above. BrioSQRReport : Brio SQR Report List for discussion of SQR and SQR Developer (formerly called Brio.Report and Report Builder). To join, follow the link above, or send any message to "BrioSQRReport- subscribe@yahoogroups.com". rm-users : Report- Mart Users List for discussion of Brio Portal (previously called ReportMart). To join, follow the link above, or send a message containing the word "subscribe" in the body to "rm-users- request@sqrug.org". brioportalusersgroup : Brio Portal Users Group list List for discussion of Brio Portal. To join, follow the link above, or send any message to "brioportalusersgroup- subscribe@yahoogroups.com". brio-l : OpenITx Brio List List for technical and functional discussion of all Brio products (but most messages are currently about Brio Intelligence). To join, follow the link above. briousers : Brio.Enter- prise Users List for discussion of the Brio.Enterprise (now called Intelligence) product. To join, follow the link above, or send any message to "briousers-subscribe@yahoogroups.com". briolist : Brio List List for discussion of Brio Intelligence. To join, follow the link above, or send any message to "briolist- subscribe@yahoogroups.com". 3. Interacting with the list server The sqr-users mailing list is hosted using the Mailman list server package. All of the Mailman functions described below are accessed from the sqr-users List Info page, "http://www.sqrug.org/mailman/listinfo/sqr-users". 3.1. Subscribing to the list To subscribe to the mailing list, enter your e-mail address in the box at the top of the "Subscribing to sqr-users" section on the sqr-users List Info page, then choose a password to assign to your subscription and enter it in both "Password" boxes. This password is used to allow you to securely make changes to your subscription over the web. This password will be e-mailed back to you at varous times, so you should not use the same password as you are using elsewhere. Once you have filled in the password, click the "Subscribe" button. You should soon receive an e-mail message from the list server requesting confirmation of your subscription request. Once you have replied to this message and your subscription has been processed, you will receive a "welcome" message giving you more information on the list server, and as well as a reminder of the subscription password you chose. 3.2. Unsubscribing from the list To unsubscribe from the list, go to the sqr-users List Info page, enter your e-mail address in the "sqr-users Subscribers" section near the bottom of the page, and click the "Unsubscribe or edit options" button. You will then see the "member options" page; fill in your password at the top of the page and click "Log in". (If you have forgotton your password, see the ``Obtaining your Password'' section, below). This will take you to the "membership configuration" page. In the middle of that page, there will be an "Unsubscribing from sqr- users" section; simply turn on the "Yes, I really want to unsubscribe" checkbox and click the "Unsubscribe" button. You should get a page back saying that the removal was successful (as well as a confirmation email message). The removal will take effect immediately; there is no need to send in a confirmation e-mail message. If you don't know your password, you can choose to unsubscribe using e-mail confirmation. Instead of entering the password on the "member options" page, just click the "Unsubscribe" button found just below the "Log In" button. You will then see a page noting that a confirmation e-mail has been sent; once you follow the confirmation instructions in that e-mail your removal will be complete. 3.3. When your email address changes If your e-mail address changes -- for example, if your company changes names, or if your mail administrator changes the way your name is spelled out or abbreviated -- you will need to update your subscription to match your new address before you can post to the list (see the ``Posting'' section, below). To do this, simply log in to your "membership configuration" page (see the directions for logging in to this page in the ``Unsubscribing'' section, above). At the top of that page you'll see a "Changing your membership information" section. Fill out the text boxes and click the "Change My Address and Name" button. You will be sent a confirmation e-mail, and once you have responded to that e-mail your subscription will be updated and you can begin posting from your new address. 3.4. Digests You can request to get your messages in digest form (one large message containing all of the posts made each day). To do this, log in to your "membership configuration" page (see the directions on doing this in the ``Unsubscribing'' section, above). At the bottom of the page, you will see a section titled "Your sqr-users Subscription Options". Change the "Set Digest Mode" option (the second option in the list) to "On" and click the "Submit My Changes" button at the bottom of the page. You actually have a choice of two different digest formats, "MIME" or "Plain Text". The MIME format sends each individual list message as a separate MIME attachment to the digest; the plain text format consists of one large text message, with all of the individual messages run together. Which format you will want to use depends on your mail- reading software (and personal preference). If you are not sure which format will work best, you can just leave the default setting of "MIME" and see if the next morning's digest is easy to read in your mail reader -- you can change to the other format at any time using that same web page. If you use digests, you should not just "reply" to the digest mailing. Instead, be sure your message's subject header matches the subject in the original posting to which you are replying, and that you don't include a quoted copy of the entire digest in your post. To restore normal distribution, simply follow the above instructions choosing the "Off" setting for the Digest option. 3.5. Obtaining your password You will not be able to change your subscription options without your password. If you have forgotten your password, simply click the "Email My Password to Me" button on the "member options" page and your password will be emailed to you. You will also be e-mailed a copy of your password at the beginning of each month, as part of a "mailing list memberships reminder" message from the Mailman software. 3.6. Problems If the above instructions do not work, please contact the list manager at "sqr-users-manager@sqrug.org". (Do not send a message to the list itself -- no one there can help you with your problem!) Please include a description of what you were trying to do and what exactly happened when you made the attempt. 4. Posting to the sqr-users List In order to post to the mailing list, you must be subscribed to it (see directions above). More specifically, in order for Mailman to recognize that this message was sent by a subscriber, the return address on your message much exactly match the addresss you used to subscribe -- if you have more than one address you will need to be sure that you are sending from the correct one. (See the ``When you email address changes'' section, above, if your e-mail address has changed since you subscribed.) 4.1. General Guidelines For any message you send to the list, please: o make sure your mail software is not requesting a "Return Receipt". (If a "Return Receipt Requested" message is sent to the list, several dozen receipt messages will be sent out to the mailing list as other subscribers' mail systems repond....) o do not send messages in HTML or other special formats. (These are not usable by many subscribers, especially those who receive their messages in digest format.) The list server will delete these special attachments from your message and send you a warning notice. Also, if you are trying to send (for example) SQR source code files, make sure your mail-reader software is assigning proper MIME types to your attachments or they may not be distributed. o keep in mind that over 500 people will receive your message, and that it will appear in the list archives. Try to keep your messages on-topic and relatively short. Consider sending your message directly to particular people if it won't interest many of the list's subscribers. o ignore abusive and inappropriate messages that get sent to the list, rather than getting drawn into a debate. The very nature of these messages will cause most subscribers to automatically discredit them -- no "response" is necessary. To the contrary, any response will only "add fuel to the fire," prolonging the controversy and further interupting the normal conversation on the list. 4.2. Posting a Message Once you are subscribed, you can post to the list by sending a message to "sqr-users@sqrug.org". Be sure your subject heading describes your specific problem or question (i.e. don't just use "SQR Question"). In the body of your message, please include the following information: o SQR product name and version number (see notes below) o Operating system name and version number o Database name and version number o Application name (i.e. PeopleSoft) and a version number, if any Also, include a short code sample whenever possible. It's much easier for other people to understand what you are trying to do when they can see the actual code. (At the same time, be careful not to post confidential or proprietary code, since the posting will be placed in a public web archive.) Note that your question should relate to SQR or other Brio Report product in some way. Don't ask questions about PeopleSoft, for example, unless you are having SQR-related issues. (For PeopleSoft- specific questions, see other lists mentioned in the ``Related Mailing Lists'' section.) In 2001, PeopleSoft purchased from Brio the rights to the source code for SQR and began releasing its own line of SQR. PeopleSoft's SQR version numbering is different from Brio/Hyperion's, so it's very important to mention whether you are using Hyperion's "SQR" or "SQR for PeopleSoft". (This info is included automatically if you include the full SQR version-id string as described below.) To get the version-id string for your copy of SQR, you can run the following program: begin-program show $sqr-ver end-program This will produce a line that looks something like this: SQR/3.0.15/Intel/SCO Unix R3.2 V5.0/Oracle 7.2.2.3/Sep 25 1996 Include the full line of output in your message. Note that the oper- ating system and database version numbers listed here are the ones under which this copy of SQR was compiled, so you'll still need to include this information for your own environment. In a command-line environment (Unix, etc.), you can also get this version-id string by saying sqr -id 4.3. Replying to a Message Messages sent out on the list have a Reply-To header pointing to the list. This means that you should be able to simply use your mail reader's "reply" function to send a reply to the list. Generally, all answers to questions sent out on the list should be public replies, so that other subscribers can benefit. In those cases where a private reply is appropriate, be sure to over-ride the default Reply-To address. If your message is not actually a reply to the earlier message, please do not use the "reply" function. Instead, address a new e-mail message to the list as described in the previous section. (This is because the list archives will incorrectly show the new message in the original thread if you use "reply".) You should quote enough lines from the original message that later readers can understand your answer even if they missed the original question. At the same time, you should remove any unnecessary lines from the quote in order to make your message shorter and easier to understand. (Remember that some people read the mailing list in digest form, and the digests become much larger if unnecessary lines are quoted.) 5. Job Announcements Please do not post job announcements on the sqr-users list, but use the sqr-jobs list instead. (See ``Related Mailing Lists'' for more information on this list.) A large number of sqr-users subscribers do not want to receive job announcements (for various reasons) and such posts tend to cause a lot of disruption of the discussion on the list. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 03 00:17:22 2005 Date: Mon, 2 May 2005 22:16:17 -0700 (PDT) From: aravind kumar Subject: RE: [sqr-users] Flat File Hi Radhika, It might be bad inbound file. Check for the two blank rows in the end of input file. That might be problem. Aravind --- "Kaithi, Murali" wrote: > Hi Radhika, > I am hoping its bad text file. I experienced this > kind of problem > before. > Check your text file thoroughly. > > Murali. > > -----Original Message----- > From: > sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org > [mailto:sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org] > On > Behalf Of radhika reddy > Sent: Sunday, April 10, 2005 12:40 PM > To: sqr-users@sqrug.org > Subject: [sqr-users] Flat File > > Hi, > > I am reading a flat file and inserting into > tables(Inbound > interface). I am having a problem reading it, when i > reach end of file > it is still looking for data and taking it as empty > record. The program > is working good except that the number of errors is > added by 1 though > it's not. > > I use While loop for looping through the flat file > and also i am > checking end of file condition too. Is this the bad > flat file or am I > missing something? > > Thanks. Any input would be appreciated. > > _________________________________________________________________ > Don't just search. Find. Check out the new MSN > Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email > Security System. > For more information please visit > http://www.messagelabs.com/email > ______________________________________________________________________ > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 03 06:06:42 2005 Date: Tue, 3 May 2005 07:04:30 -0400 (GMT-04:00) From: "fpickava@earthlink.net" Subject: RE: [sqr-users] Flat File Edit the input and delete all spaces beyound the last good record. Frank P. -----Original Message----- From: aravind kumar Sent: May 3, 2005 1:16 AM To: "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Subject: RE: [sqr-users] Flat File Hi Radhika, It might be bad inbound file. Check for the two blank rows in the end of input file. That might be problem. Aravind --- "Kaithi, Murali" wrote: > Hi Radhika, > I am hoping its bad text file. I experienced this > kind of problem > before. > Check your text file thoroughly. > > Murali. > > -----Original Message----- > From: > sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org > [mailto:sqr-users-bounces+murali.kaithi=spencergifts.com@sqrug.org] > On > Behalf Of radhika reddy > Sent: Sunday, April 10, 2005 12:40 PM > To: sqr-users@sqrug.org > Subject: [sqr-users] Flat File > > Hi, > > I am reading a flat file and inserting into > tables(Inbound > interface). I am having a problem reading it, when i > reach end of file > it is still looking for data and taking it as empty > record. The program > is working good except that the number of errors is > added by 1 though > it's not. > > I use While loop for looping through the flat file > and also i am > checking end of file condition too. Is this the bad > flat file or am I > missing something? > > Thanks. Any input would be appreciated. > > _________________________________________________________________ > Don't just search. Find. Check out the new MSN > Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email > Security System. > For more information please visit > http://www.messagelabs.com/email > ______________________________________________________________________ > > _______________________________________________ > sqr-users mailing list > sqr-users@sqrug.org > http://www.sqrug.org/mailman/listinfo/sqr-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed May 04 12:58:32 2005 Date: Wed, 4 May 2005 13:57:28 -0400 (EDT) From: Jay Subject: [sqr-users] SQL Server - Connect to different Server Hi all, Peopletools 8.45.10, App 8.8, SQR for Peoplesoft V8.45.10, NT servers. I have a requirement to run an SQR that truncates/selects from our HRPRJ81 (HR) database and insert to our FSDEV8 (Finance) database. The databases exist on physically different servers. I've gone through the archives and used that as the basis for my sql, but I'm not having any luck. This code: Begin-SQL -DB'DSN=HRPRJ81;UID=peoXXX;PWD=peoXXX' TRUNCATE TABLE PS_TL_PROJECT TRUNCATE TABLE PS_TL_PRODUCT_TBL TRUNCATE TABLE PS_TL_USER_FIELD_1 TRUNCATE TABLE PS_TL_USER_FIELD_2 end-SQL when running on our FSDEV8 gives this error: SQR 1803) CONNECT failed. Perhaps username/password incorrect. SQR for PeopleSoft: Program Aborting. Some of the archives mention an ODBC version of SQR. Do we have to use a different version of SQR? I am using the same User ID and Password I specify in my local ODBC setup for HRPRJ81. Is that correct? Do I have to put the server name in front of the database name like I do through Query Analyzer? Any help appreciated. thanks jay ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Wed May 04 13:09:15 2005 Date: Thu, 05 May 2005 04:07:48 +1000 From: "Ian Mills" Subject: Re: [sqr-users] SQL Server - Connect to different Server (On Leave) I will be on leave from 5/5/2005 to 9/5/2005. If you need assistance during this time, please contact Raymond Beddie. _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu May 05 04:02:02 2005 From: "Ravindran Rajan" Date: Thu, 5 May 2005 14:29:22 +0530 Subject: [sqr-users] Reg : Hyperion Integration Hi all, This is my first mail to this Group. I have some Problem with integrating Hyperion SQR with .NET Web Application. I have tried to run .SQR file using SQRW.exe Command line execution & used it in Java Script. I tried to include sqrw.dll file as a reference in .NET but it is not a COM supported DLL so it is not included... Is there any other method to Integrate like Using DLL or API's....... If possible give me some sample coding............. Thank you.. ______________________________________________________________________ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Thu May 05 08:14:40 2005 Subject: Re: [sqr-users] SQL Server - Connect to different Server From: Ramzi_Salameh@daveandbusters.com Date: Thu, 5 May 2005 08:12:13 -0500 If your database platform is MS SQL Server you may have to create a linked server from one database to the other. ----------------------------------------------------- Ramzi Salameh Senior Technical Analyst (214) 904-2550 Dave and Buster's, Inc. ----------------------------------------------------- Jay Sent by: sqr-users-bounces+ramzi_salameh=daveandbusters.com@sqrug.org 05/04/2005 12:57 PM Please respond to "This list is for discussion about the SQR database reporting language from Hyperion Solutions." To: sqr-users@sqrug.org cc: Subject: [sqr-users] SQL Server - Connect to different Server Hi all, Peopletools 8.45.10, App 8.8, SQR for Peoplesoft V8.45.10, NT servers. I have a requirement to run an SQR that truncates/selects from our HRPRJ81 (HR) database and insert to our FSDEV8 (Finance) database. The databases exist on physically different servers. I've gone through the archives and used that as the basis for my sql, but I'm not having any luck. This code: Begin-SQL -DB'DSN=HRPRJ81;UID=peoXXX;PWD=peoXXX' TRUNCATE TABLE PS_TL_PROJECT TRUNCATE TABLE PS_TL_PRODUCT_TBL TRUNCATE TABLE PS_TL_USER_FIELD_1 TRUNCATE TABLE PS_TL_USER_FIELD_2 end-SQL when running on our FSDEV8 gives this error: SQR 1803) CONNECT failed. Perhaps username/password incorrect. SQR for PeopleSoft: Program Aborting. Some of the archives mention an ODBC version of SQR. Do we have to use a different version of SQR? I am using the same User ID and Password I specify in my local ODBC setup for HRPRJ81. Is that correct? Do I have to put the server name in front of the database name like I do through Query Analyzer? Any help appreciated. thanks jay ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon May 09 11:19:12 2005 From: Roger.Harris@certegy.com Date: Mon, 9 May 2005 12:17:55 -0400 Subject: [sqr-users] SQR knowledge testing I have been tasked to develop an SQR knowledge test to pre-screen potential job candidates. Has anyone else come up with a 20 questions type list that they would be willing to share? Thanx ------------------------------------------------------------------------------ This message contains information from Certegy, Inc which may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify by e:mail postmaster@certegy.com. ============================================================================== _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Mon May 09 11:36:48 2005 Date: Mon, 9 May 2005 12:35:48 -0400 (EDT) From: Janet Shum Subject: [sqr-users] SQR - font prints bold when not set to bold Hi I do not believe I am using a line printer I am having trouble with the fonts. It seems like it is printing something in bold when the there is no bold after the print command, even after I set the font with alter printer right before it Anyone else run into anything similar ______________________________________________________________________ Post your free ad now! http://personals.yahoo.ca _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 09:27:12 2005 From: "Wyatt, Will" Date: Tue, 10 May 2005 09:37:52 -0500 Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 09:55:57 2005 From: Bob Stone Subject: RE: [sqr-users] Virtual Table Date: Tue, 10 May 2005 09:54:48 -0500 It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (or whatever the default string auto-date conversion type for SQL Server is) and then just said " AND N_ED.EFFDT <= $AsOfDate " it might go through. Otherwise, if that doesn't work, you might have to figure out some other way to write the SQL itself...maybe loop through one table on the name, set a variable, and within that SQL block call a procedure to loop through the other tables, using that name variable instead of a table join. Might be slightly less efficient, but at least it would work. Bob -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 9:38 AM To: 'sqr-users@sqrug.org' Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:02:53 2005 From: "Wyatt, Will" Subject: RE: [sqr-users] Virtual Table Date: Tue, 10 May 2005 10:13:23 -0500 I changed the subquery to just say 'AND N_ED.EFFDT <= $AsOfDate' and got the same error. Thanks for the suggestion. -----Original Message----- From: sqr-users-bounces+willw=aisd.org@sqrug.org [mailto:sqr-users-bounces+willw=aisd.org@sqrug.org] On Behalf Of Bob Stone Sent: Tuesday, May 10, 2005 9:55 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (or whatever the default string auto-date conversion type for SQL Server is) and then just said " AND N_ED.EFFDT <= $AsOfDate " it might go through. Otherwise, if that doesn't work, you might have to figure out some other way to write the SQL itself...maybe loop through one table on the name, set a variable, and within that SQL block call a procedure to loop through the other tables, using that name variable instead of a table join. Might be slightly less efficient, but at least it would work. Bob -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 9:38 AM To: 'sqr-users@sqrug.org' Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:05:56 2005 From: "radhika reddy" Date: Tue, 10 May 2005 10:01:47 -0500 Subject: [sqr-users] date format Hi, I always have tough time to format dates. This time the date that I get from a flat file is in 'YYYYMMDD' format. However i do it i get errors. I tried doing something like this:- Let $activity_date = edit($activity_date, 'dd-mon-yyyy') or let $activity_date = to_char(to_date($activity_date, 'YYYYMMDD'), 'dd-MON-yyyy') and let $activity_date = Datetostr(StrtoDate($activity_date,'YYYYMMDD'),'dd-MON-yyyy') and begin-select on-error=print-date-error to_char(to_date($activity_date, 'MM/DD/YYYY'), 'dd-MON-yyyy') &activitydate move &activitydate to $activity_date from dual Any idea where i am going wrong on this? Thanks. _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:08:53 2005 From: James Womeldorf Subject: RE: [sqr-users] Virtual Table Date: Tue, 10 May 2005 10:04:39 -0500 Hi Will, Just a thought, but are you certain that $AsOfDate is actually a string and not a date? I'm not acquainted with the CONVERT function but it looks like it is expecting a string in this case. SQR has this 'neat' feature of using the same symbol $ to designate strings and dates and sometimes I get them confused. Jim -----Original Message----- From: sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org [mailto:sqr-users-bounces+jwomeldo=fastenal.com@sqrug.org]On Behalf Of Bob Stone Sent: Tuesday, May 10, 2005 9:55 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (or whatever the default string auto-date conversion type for SQL Server is) and then just said " AND N_ED.EFFDT <= $AsOfDate " it might go through. Otherwise, if that doesn't work, you might have to figure out some other way to write the SQL itself...maybe loop through one table on the name, set a variable, and within that SQL block call a procedure to loop through the other tables, using that name variable instead of a table join. Might be slightly less efficient, but at least it would work. Bob -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 9:38 AM To: 'sqr-users@sqrug.org' Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:12:22 2005 Subject: RE: [sqr-users] Virtual Table Date: Tue, 10 May 2005 08:08:25 -0700 From: "Pedroza, Maricela" Have you tried replacing the effdt logic with something like,=20 AND N_ED.EFFDT <=3D SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10) Maricela -----Original Message----- From: sqr-users-bounces+mpedroza=3Dcerritos.edu@sqrug.org [mailto:sqr-users-bounces+mpedroza=3Dcerritos.edu@sqrug.org] On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 8:13 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table I changed the subquery to just say 'AND N_ED.EFFDT <=3D $AsOfDate' and got the same error. Thanks for the suggestion. -----Original Message----- From: sqr-users-bounces+willw=3Daisd.org@sqrug.org [mailto:sqr-users-bounces+willw=3Daisd.org@sqrug.org] On Behalf Of Bob Stone Sent: Tuesday, May 10, 2005 9:55 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (or whatever the default string auto-date conversion type for SQL Server is) and then just said " AND N_ED.EFFDT <=3D $AsOfDate " it might go through.=20=20 Otherwise, if that doesn't work, you might have to figure out some other way to write the SQL itself...maybe loop through one table on the name, set a variable, and within that SQL block call a procedure to loop through the other tables, using that name variable instead of a table join. Might be slightly less efficient, but at least it would work. Bob -----Original Message----- From: sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=3Dfastenal.com@sqrug.org]On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 9:38 AM To: 'sqr-users@sqrug.org' Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT =3D=20 ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID =3D N_ED.EMPLID AND N_ED.EFFDT <=3D SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT =3D=20 ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID =3D N_ED.EMPLID AND N_ED.EFFDT <=3D SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <=3D SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:15:28 2005 Subject: RE: [sqr-users] date format Date: Tue, 10 May 2005 10:11:43 -0500 From: "Lindquist, Maria" Did you try the following at all?=20 Let $Activity_Date =3D TO_DATE($Activity_date,'dd-mon-yyyy')=20 Maria -----Original Message----- From: sqr-users-bounces+mlindqui=3Duwc.edu@sqrug.org [mailto:sqr-users-bounces+mlindqui=3Duwc.edu@sqrug.org] On Behalf Of radhika reddy Sent: Tuesday, May 10, 2005 10:02 AM To: sqr-users@sqrug.org Subject: [sqr-users] date format Hi, I always have tough time to format dates. This time the date that I get from a flat file is in 'YYYYMMDD' format. However i do it i get errors. I tried doing something like this:- Let $activity_date =3D edit($activity_date, 'dd-mon-yyyy') or let $activity_date =3D to_char(to_date($activity_date, 'YYYYMMDD'), 'dd-MON-yyyy') and let $activity_date =3D Datetostr(StrtoDate($activity_date,'YYYYMMDD'),'dd-MON-yyyy') and begin-select on-error=3Dprint-date-error to_char(to_date($activity_date, 'MM/DD/YYYY'), 'dd-MON-yyyy') &activitydate move &activitydate to $activity_date from dual Any idea where i am going wrong on this? Thanks. _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee(r) Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3D3963 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:18:37 2005 From: "Wyatt, Will" Subject: RE: [sqr-users] Virtual Table Date: Tue, 10 May 2005 10:27:20 -0500 Based on what James Womeldorf and you have said I changed the query to: let $name = 'Wyatt' begin-select A.FIRST_NAME A.LAST_NAME print &A.LAST_NAME (+1, 1) FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT <= '2005-05-31' AND NAMES.LAST_NAME = $name ) AS A end-select and I still get an error, but begin-select A.FIRST_NAME A.LAST_NAME print &A.LAST_NAME (+1, 1) FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT <= '2005-05-31' AND NAMES.LAST_NAME = 'Wyatt' ) AS A end-select works, so I don't think it is the effective date logic. This list is amazing, I never expected to get help so quickly. -----Original Message----- From: sqr-users-bounces+willw=aisd.org@sqrug.org [mailto:sqr-users-bounces+willw=aisd.org@sqrug.org] On Behalf Of Pedroza, Maricela Sent: Tuesday, May 10, 2005 10:08 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: RE: [sqr-users] Virtual Table Have you tried replacing the effdt logic with something like, AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10) Maricela -----Original Message----- From: sqr-users-bounces+mpedroza=cerritos.edu@sqrug.org [mailto:sqr-users-bounces+mpedroza=cerritos.edu@sqrug.org] On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 8:13 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table I changed the subquery to just say 'AND N_ED.EFFDT <= $AsOfDate' and got the same error. Thanks for the suggestion. -----Original Message----- From: sqr-users-bounces+willw=aisd.org@sqrug.org [mailto:sqr-users-bounces+willw=aisd.org@sqrug.org] On Behalf Of Bob Stone Sent: Tuesday, May 10, 2005 9:55 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (or whatever the default string auto-date conversion type for SQL Server is) and then just said " AND N_ED.EFFDT <= $AsOfDate " it might go through. Otherwise, if that doesn't work, you might have to figure out some other way to write the SQL itself...maybe loop through one table on the name, set a variable, and within that SQL block call a procedure to loop through the other tables, using that name variable instead of a table join. Might be slightly less efficient, but at least it would work. Bob -----Original Message----- From: sqr-users-bounces+bstone=fastenal.com@sqrug.org [mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 9:38 AM To: 'sqr-users@sqrug.org' Subject: [sqr-users] Virtual Table Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:21:39 2005 Subject: RE: [sqr-users] date format Date: Tue, 10 May 2005 09:15:01 -0600 From: "Jon Alsager" Maybe try this: let $activity_date =3D strtodate($activity_date, 'YYYYMMDD') Jon -----Original Message----- From: sqr-users-bounces+jalsager=3Disif.state.id.us@sqrug.org [mailto:sqr-users-bounces+jalsager=3Disif.state.id.us@sqrug.org] On Behalf Of radhika reddy Sent: Tuesday, May 10, 2005 9:02 AM To: sqr-users@sqrug.org Subject: [sqr-users] date format Hi, I always have tough time to format dates. This time the date that I get=20 from a flat file is in 'YYYYMMDD' format. However i do it i get errors. I tried doing something like this:- Let $activity_date =3D edit($activity_date, 'dd-mon-yyyy') or let $activity_date =3D to_char(to_date($activity_date, 'YYYYMMDD'),=20 'dd-MON-yyyy') and let $activity_date =3D=20 Datetostr(StrtoDate($activity_date,'YYYYMMDD'),'dd-MON-yyyy') and begin-select on-error=3Dprint-date-error to_char(to_date($activity_date, 'MM/DD/YYYY'), 'dd-MON-yyyy') &activitydate move &activitydate to $activity_date from dual Any idea where i am going wrong on this? Thanks. _________________________________________________________________ Is your PC infected? Get a FREE online computer virus scan from McAfee(r)=20 Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3D3963 _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:24:39 2005 Subject: Re: [sqr-users] Virtual Table From: Olga.Gal@bbh.com Date: Tue, 10 May 2005 11:18:55 -0400 I guess the other way of doing that could be creating a view with the select statement that is in the FROM Clause, and referencing that view in your FROM clause. Your view then should have EMPLID and EFFDT columns, and your main Where Clause should have the MAX subquery: BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM MY_VIEW A WHERE A.EFFDT = (SELECT MAX(EFFDT) FROM MY_VIEW B WHERE B.EMPLID = A.EMPLID AND EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) ) END-SELECT "Wyatt, Will" Sent by: sqr-users-bounces+olga.gal=bbh.com@sqrug.org To "'sqr-users@sqrug.org'" 05/10/2005 10:37 AM cc Subject Please respond to [sqr-users] Virtual Table "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Hi all. I'm not sure what to call the problem I'm having writing this query in SQR. I'm using MS SQL Server w/ PeopleSoft. My query is actually more complex, but this demonstrates the problem. The query works fine in Query Analyzer. SELECT A.FIRST_NAME, A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A I try to move this query to SQR and produced BEGIN-SELECT A.FIRST_NAME A.LAST_NAME FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT = ( SELECT MAX(N_ED.EFFDT) FROM PS_NAMES N_ED WHERE NAMES.EMPLID = N_ED.EMPLID AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,'2005-05-31',121), 1, 10) ) ) AS A END-SELECT My problem is when I try to replace the '2005-05-31' in the effective dated logic with a variable, something like AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,$AsOfDate,121), 1, 10) I get an SQR 1303 error 'Error in SQL (perhaps missing &name after expression). I suspect that I can't do this because the virtual table A isn't really a table as far as SQR is concerned. Is there someway I can do this. PS. Is there a technical name for what I'm trying to do with the Select statement that is creating table A in the main query? TIA. -------------------------------------- Will Wyatt PeopleSoft Analyst Abilene Independent School District _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:28:00 2005 From: "radhika reddy" Subject: RE: [sqr-users] date format Date: Tue, 10 May 2005 10:25:30 -0500 yes, i tried and i get the following error: (SQR 4008) Unknown function or variable in expression: to_date let $activity_date = to_date($activity_date,'dd-mon-yyyy') thanks. >From: "Lindquist, Maria" >Reply-To: "This list is for discussion about the SQR database >reportinglanguage from Hyperion Solutions." >To: "This list is for discussion about the SQR database reportinglanguage >fromHyperion Solutions." >Subject: RE: [sqr-users] date format >Date: Tue, 10 May 2005 10:11:43 -0500 > >Did you try the following at all? > >Let $Activity_Date = TO_DATE($Activity_date,'dd-mon-yyyy') > >Maria > >-----Original Message----- >From: sqr-users-bounces+mlindqui=uwc.edu@sqrug.org >[mailto:sqr-users-bounces+mlindqui=uwc.edu@sqrug.org] On Behalf Of >radhika reddy >Sent: Tuesday, May 10, 2005 10:02 AM >To: sqr-users@sqrug.org >Subject: [sqr-users] date format > >Hi, > > I always have tough time to format dates. This time the date that I >get from a flat file is in 'YYYYMMDD' format. However i do it i get >errors. > >I tried doing something like this:- > >Let $activity_date = edit($activity_date, 'dd-mon-yyyy') > >or > >let $activity_date = to_char(to_date($activity_date, 'YYYYMMDD'), >'dd-MON-yyyy') >and > >let $activity_date = >Datetostr(StrtoDate($activity_date,'YYYYMMDD'),'dd-MON-yyyy') > >and > >begin-select on-error=print-date-error >to_char(to_date($activity_date, 'MM/DD/YYYY'), 'dd-MON-yyyy') >&activitydate > move &activitydate to $activity_date >from dual > >Any idea where i am going wrong on this? > >Thanks. > >_________________________________________________________________ >Is your PC infected? Get a FREE online computer virus scan from >McAfee(r) Security. >http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 > > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users > >_______________________________________________ >sqr-users mailing list >sqr-users@sqrug.org >http://www.sqrug.org/mailman/listinfo/sqr-users _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ _______________________________________________ sqr-users mailing list sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users From sqr-users-bounces+sqrusersarch=sqrug.org@sqrug.org Tue May 10 10:31:15 2005 Subject: RE: [sqr-users] Virtual Table From: Olga.Gal@bbh.com Date: Tue, 10 May 2005 11:25:05 -0400 That is because the error DOESN'T refer to the Where Clause of your 'Virtual Table', but to the selected columns. In other words from some reason SQR is expecting alias name after NAMES.FIRST_NAME and NAMES.LAST_NAME "Wyatt, Will" Sent by: sqr-users-bounces+olga.gal=bbh.com@sqrug.org To "'This list is for discussion about the SQR database reporting language from Hyperion Solutions.'" 05/10/2005 11:27 AM cc Subject Please respond to RE: [sqr-users] Virtual Table "This list is for discussion about the SQR database reporting language from Hyperion Solutions." Based on what James Womeldorf and you have said I changed the query to: let $name = 'Wyatt' begin-select A.FIRST_NAME A.LAST_NAME print &A.LAST_NAME (+1, 1) FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT <= '2005-05-31' AND NAMES.LAST_NAME = $name ) AS A end-select and I still get an error, but begin-select A.FIRST_NAME A.LAST_NAME print &A.LAST_NAME (+1, 1) FROM ( SELECT NAMES.FIRST_NAME, NAMES.LAST_NAME FROM PS_NAMES NAMES WHERE NAMES.EFFDT <= '2005-05-31' AND NAMES.LAST_NAME = 'Wyatt' ) AS A end-select works, so I don't think it is the effective date logic. This list is amazing, I never expected to get help so quickly. -----Original Message----- From: sqr-users-bounces+willw=aisd.org@sqrug.org [mailto:sqr-users-bounces+willw=aisd.org@sqrug.org] On Behalf Of Pedroza, Maricela Sent: Tuesday, May 10, 2005 10:08 AM To: This list is for discussion about the SQR database reporting language from Hyperion Solutions. Subject: RE: [sqr-users] Virtual Table Have you tried replacing the effdt logic with something like, AND N_ED.EFFDT <= SUBSTRING(CONVERT(CHAR,GETDATE(),121), 1, 10) Maricela -----Original Message----- From: sqr-users-bounces+mpedroza=cerritos.edu@sqrug.org [mailto:sqr-users-bounces+mpedroza=cerritos.edu@sqrug.org] On Behalf Of Wyatt, Will Sent: Tuesday, May 10, 2005 8:13 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table I changed the subquery to just say 'AND N_ED.EFFDT <= $AsOfDate' and got the same error. Thanks for the suggestion. -----Original Message----- From: sqr-users-bounces+willw=aisd.org@sqrug.org [mailto:sqr-users-bounces+willw=aisd.org@sqrug.org] On Behalf Of Bob Stone Sent: Tuesday, May 10, 2005 9:55 AM To: 'This list is for discussion about the SQR database reporting language from Hyperion Solutions.' Subject: RE: [sqr-users] Virtual Table It's called an inline view. Making a 'fake table' or 'virtual table' in the from clause of the select is an inline view. I'm not sure why SQR is having this problem, but I know I've used variables in an inline view in SQR and it's worked. I'm wondering if maybe the functions plus the variable (and being within the inline view) are what's causing the problem. (just an idea...i dont know for sure). We use oracle, but I think a similar principal will work in MS SQL Server. The default date type conversion of a string will happen in Oracle when the string variable is in the form 'DD-MON-YYYY' or 'DD-MON-YY', so if you did a little SQR variable conversion (or SQL edit mask if you're grabbing that date from a table) to set up $AsOfDate like 'DD-MON-YYYY' (o