[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



Hmmm.  If you could get the desired array size onto the command line you
might just be able to make it work.  This sample shows how ask can be used
to set array size using a replacement variable.  Don't know that this method
would work if you are executing SQTs though.


BEGIN-SETUP

        DECLARE-LAYOUT DEFAULT
                LEFT-MARGIN         =.25
                RIGHT-MARGIN    = 0
                BOTTOM-MARGIN   =.25
                ORIENTATION     = PORTRAIT
        END-DECLARE

!       #DEFINE         ArraySize               25
        ASK ArraySize 'What size is the array?'

END-SETUP


BEGIN-PROGRAM
        !       Create array using size from the ASK
        CREATE-ARRAY 
                NAME    = TestArray 
                SIZE    = {ArraySize} 
!               EXTENT  = 10
                FIELD   = Moped:NUMBER

        PRINT '-----------' (+1,10,000)

        !       Stash some values into the array
        LET #idx = 0
        WHILE #idx <= {ArraySize}
                PUT #idx INTO TestArray(#idx)
                ADD 1 TO #idx
        END-WHILE

        !       Retrieve and print what we just stashed
        LET #idx = 0
        WHILE #idx <= {ArraySize}
                GET #idxOut FROM TestArray(#idx)
                ADD 1 TO #idx
                PRINT #idxOut (+1,10,00)
        END-WHILE

-----Original Message-----
From: sqr-users-bounces+jeff.steinfeldt=wellsfargo.com@sqrug.org
[mailto:sqr-users-bounces+jeff.steinfeldt=wellsfargo.com@sqrug.org] On
Behalf Of Sony Dada
Sent: Wednesday, February 23, 2005 11: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