[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] dynamic array size



There are a few kludges possible.  The only question is how far you'll go.

1. Write another SQR program that gets the count from abc_table.

2a. Have it do a "call system" to execute your main program with the count
as one of the parameters.  Put an "ask" in your main program.

2b. Have it write a file with the name "count.sqc" and the contents "#define
abc_count 100"  Then have it execute your main program, or execute it
yourself.  Then main program needs the following statements:

#include 'count.sqc'

begin-setup
  create-array name BUs size={abc_count}
...
end-setup


Alternately, make the array big enough for anything.  Are these Peoplesoft
Business Units?  Your organization isn't going to vary the number of
business units by an order of magnitude.  If they're something else, make
the array 1000 or 100,000.  Modern PCs or servers have hundreds or thousands
of megabytes of main memory and operating systems that offer even more
virtual memory.  Go crazy if you have to - the memory will be there.

If you're using the array simply to record the name of each business unit,
and you're reading it once from a table and not changing it, consider
"load-lookup."

-----Original Message-----
From: Sony Dada [mailto:sony_dada@hotmail.com]
Sent: Wednesday, February 23, 2005 9:26 AM
To: sqr-users@sqrug.org
Subject: RE: [sqr-users] dynamic array size


I am not ruling out both (Richard & Jeff's) of your comments, but if we look

at Dan's email which was posted in 2001, it looks like there is a 
possibility. Our sqr version is
with SQR for PeopleSoft/8.45.05.
----------------------------------------------------------------------------
---------
Subject: Re: dynamic array size?
From: "Johnson, Dan" <Dan_Johnson@WRIGHTEXPRESS.COM>
Date: Fri, 19 Oct 2001 16:33:54 -0400

----------------------------------------------------------------------------
----

There is a kludge for this. Unfortunately it only works for certain
situations. You can use "ask" to get the array size. For instance we count
the rows in a specific table and then call the sqr that has the array in it
passing the row count as a parameter. Limited, but can be useful.

Good luck,
Dan



>From: "Knapp, Richard" <KnappR@umsystem.edu>
>Reply-To: "This list is for discussion about the SQR database 
>reportinglanguage from Hyperion Solutions." <sqr-users@sqrug.org>
>To: "This list is for discussion about the SQR database reporting 
>languagefrom Hyperion Solutions." <sqr-users@sqrug.org>
>Subject: RE: [sqr-users] dynamic array size
>Date: Wed, 23 Feb 2005 10:41:28 -0600
>
>
>For version 4.3 which I use, arrays are created before any code is
>executed so a dynamic sizing is not possible (in this version.)
>
>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
>Sony Dada
>Sent: Wednesday, February 23, 2005 10:29 AM
>To: sqr-users@sqrug.org
>Subject: [sqr-users] dynamic array size
>
>Hi,
>
>I need some advice from sqr experts. Thought it would be simple but
>having
>hardtime to resolve it.
>
>Issue:
>
>create-array name=BUs size=100
>      field=legal_entity:char
>
>I have to set above 100 as dynamic and I know the count before I create
>this
>array. So, I changed the above code as below:-
>
>select count(*) &cnt
>let #count = &cnt
>from abc_table
>   show 'count : ' #count
>
>create-array name=BUs size=#count
>      field=legal_entity:char
>
>After I changed the program, it is not recognizing the #count. I
>replaced
>with {#count} but not working. I looked at the old postings and looks
>like
>it can be resolved. Could you send some suggestions on this.
>
>Thanks in advance.
>Sony
>
>
>
>_______________________________________________
>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