BookmarkSubscribeRSS Feed
acordes
Rhodochrosite | Level 12

I am following on the subject Task Prompts used in Viusal Analytics which was nicely explained in a tutorial written by @XavierBizoux 

https://communities.sas.com/t5/SAS-Communities-Library/Create-a-SAS-Viya-Job-with-a-prompt-using-Tas... 

 

I'm struggling to populate the list box with levels available in a data source that relates to a caslib. 

 

The relevant block for the prompt generating code is:

 

Highlighted you can see my failed attempts to direct the data source to the table "REMA" in caslib "PUBLIC". 

It gives an error or fails to load the data source. 

So how do I change sashelp.cars to public.rema?

 

ok1.png 

 

<?xml version="1.0" encoding="UTF-8"?>
<Task schemaVersion="7.2">
    <Registration>
        <Name>Filter Cars</Name>
        <Description>Prompt for SASHelp Cars report</Description>
        <Version>5.2</Version>
    </Registration>
    <Metadata>
        <DataSources>
<!--             <DataSource name="dataset" defaultValue="CASUSER.VENTAS_OPE_FORM1" where="false" required="true" readOnly="true"> -->
<!--             <CasResource server="cas-shared-default" defaultValue="REMA" library="PUBLIC" table="REMA" locale="en_US"/> -->
        <DataSource name="dataset" defaultValue="SASHELP.CARS" where="false" required="true" readOnly="true"  >
<!--             <CasResource server="cas-shared-default" library="PUBLIC"/> -->
<!--             <DataSource name="dataset" defaultValue="REMA" where="false" required="true" readOnly="true"> -->
                <Filters>
                    <Filter name="originFilter">
                        <Column column="MAKE" sortBy="label" sortDirection="ascending"/>
                    </Filter>
                    <Filter name="typeFilter">
                        <Column column="MODEL" sortBy="label" sortDirection="ascending"/>
                        <Where>
                            <Expressions>
                                <Expression operation="eq">
                                    <Column column="MAKE" sortBy="label"/>
                                    <Value option="var_origin"/>
                                </Expression>
                            </Expressions>
                        </Where>
                    </Filter>
                    <Filter name="driveTrainFilter">
                        <Column column="DRIVETRAIN" sortBy="label" sortDirection="ascending"/>
                        <Where>
                            <Expressions>
                                <Expression operation="in">
                                    <Column column="MODEL" sortBy="label"/>
                                    <Value option="var_type"/>
                                </Expression>
                            </Expressions>
                        </Where>
                    </Filter>
                </Filters>
            </DataSource>
        </DataSources>
1 REPLY 1
XavierBizoux
SAS Super FREQ

Hi Arne, 

In order to be usable by the prompts, the library should be defined in the Compute session used behind the scene to retrieve the data. Usually, CAS libraries are not assigned upfront for the compute contexts. You should make sure that the library is defined in the autoexec of the compute server or that you have created the library with the flag "Assign and connect to data sources at startup" is checked as described in the following blog.

That should fix the issue. 

Regards, 

Xavier

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Discussion stats
  • 1 reply
  • 615 views
  • 0 likes
  • 2 in conversation