ASPL User's Guide v 1.00
© 2024 by SetSphere.com


11-1

   Interrogating a Set Variable

The choice for the symbol ? is adopted in ASPL as the interrogation operator. This operator, when followed by a set variable, causes ASPL to interrogate the source that resulted in creating the variable.

A set variable is created when you assign a value to it; the value is an object that represents a dataset. The set variable is stored in ASPL symbol table that you can display by typing the symbol v.

Each set variable represents a dataset that originated from some kind of source: a function, a setadic statement, a grouping expression, etc. The source is maintained in each variable, and you can view it by displaying the symbol table. In this example, we load the workspace RANDONEBIT and display the symbol table:

01:20 root@mm01: ~ #  aspl -wsname RANDONEBIT -groupingclass BITGROUP

      ______  ____    ______  __                                                                                                                   
     / __  / / ___\  / __  / / /                                                                                                                   
    / /_/ /  \ \    / ____/ / /                                                                                                                    
   / __  /  __  \  / /     / /                                                                                                                     
  / / / /  / __ / / /     / /____                                                                                                                  
 /_/ /_/   \___/ /_/     /______/                                                                                                                  
                                                                                                                                                   
                                                                                                                                                   
  STARTING ASPL SESSION WITH WORKSPACE:  RANDONEBIT
  NAMED GROUP:  BITGROUP
     last saved 2024-02-13 01:09:15.855164

1:21:19 root@mm01 /root  aspl:1 > dm 1

  DISPLAY MODE SET TO 1

1:21:25 root@mm01 /root  aspl:2 > v

     VARIABLES TYPE 1

   vname       |card      |xpC         |Lgn                             |Src
   ------------|----------|------------|--------------------------------|------------------------------------
   v1          |#31/1     |ggfunc      |g1                              |ggbitsubgS(gstart,1,gcount,1,dmin,..
   v2          |#49/1     |ggfunc      |g2                              |ggbitsubgS(gstart,2,gcount,1,dmin,..
   v3          |#28/1     |ggfunc      |g3                              |ggbitsubgS(gstart,3,gcount,1,dmin,..



Notice the Src column showing the source function that created the variable. The variables have been created by sourcing the function ggbitsubgS() and you can view this function by typing ggls ggbitsubgS() at the ASPL prompt. This function creates random number of groups, subgroups, and elements. Calling this function at different time will result with different datasets. So let's see how to interrogate the set variable.

The choice for the symbol ? is adopted in ASPL as the interrogation operator.



You can interrogate a set variable by using ? operator and ASPL will reiterate the process that sourced this variable; then ASPL will compare the previous data to the sourced data: if there is any change in the sourced data then ASPL updates the variable with the newly sourced data. When a variable is being updated, its old data is being archived and you can use the @ operator to view a variable and its archived data.