Chapter Contents

Previous

Next
SAVEENTRYDIALOG

SAVEENTRYDIALOG



Opens a dialog window that lists catalog entries, and returns the name of the selected entry

Category: Selection List


Syntax
Details
Examples
Example 1: Saving a Catalog Entry
Example 2: Using the Advanced Button with an SCL List

Syntax

selection=SAVEENTRYDIALOG(<type<,initial<,entry-name<,list-id<,description>>>>>);

selection
contains the four-level name of the selected SAS file, or a blank if nothing is selected.

Type: Character

type
specifies member types to list in the dialog window, such as CLASS, SCL, or FRAME. This can reduce the length of the list in the dialog window. If type is not used, names of all catalog entry types in the data library are listed.

Type: Character

initial
is the four-level name of the catalog entry to be the initially selected item in the dialog window when it opens.

Type: Character

entry-name
is a two- or four-level name of a catalog entry to call when a user selects the [Advanced] button in the dialog window. The entry can be any of the following types: FRAME, SCL, PROGRAM, HELP, CBT, or MENU.

If entry-name is not specified, then the window does not contain [Advanced].

Type: Character

list-id
contains the identifier of an SCL list that is passed to entry-name.

Type: Numeric or List

description
contains the description of the returned selection.

Note:   This parameter is an update parameter. See Input, Output, and Update Parameters for more information.  [cautionend]

Type: Character


Details

SAVEENTRYDIALOG enables you to implement a Save As choice by displaying a dialog window that lists entries in SAS catalogs. SAVEENTRYDIALOG returns a user's selection, which enables you to create code that performs the save action. The entry can be saved under a different name or the same name.

If entry-name is supplied, the item selected in the dialog window is passed to entry-name through the following variables, which are created automatically:

USERDATA
contains the list passed in the call to the OPENENTRYDIALOG and SAVEENTRYDIALOG functions.

LIBREF
contains the libref of the selected item.

CATALOG
contains the catalog name of the selected item.

ENTRY
contains the entry name of the selected item.

TYPE
contains the member type of the selected item.

List-id enables information to be passed between the calling entry and entry-name. It is passed to entry-name through the USERDATA variable.


Examples

Example 1: Saving a Catalog Entry

Select a catalog entry of type FRAME to save and display the selected entry.

selection=saveentrydialog('frame');
call display(selection);

Example 2: Using the Advanced Button with an SCL List

Specify an entry to call when a user selects [Advanced], as well as an SCL list that contains values to pass to the entry.

dcl list mydata;
mydata=makelist();
rc=insertc(mydata,'test');
selection=saveentrydialog('frame','mylib.mycat.inital.frame',
   'mylib.mycat.myentry.frame',mydata, description);
if sysrc(1)=-1 then do;
   ...SCL statements to execute when
   the user cancels from the window...
   rc=dellist(mydata);
end;
else do;
   ...SCL statements to handle selections...
end;
The SCL entry for MYLIB.MYCAT.MYENTRY.FRAME contains the following program:
dcl char(8)  libref;
dcl char(8)  type;
dcl char(32) catalog;
dcl char(32) entry
dcl list userdata;

init:
put libref=;
put catalog=;
put entry=;
put type=;
call putlist(userdata);
return;

Note:   The SCL entry must declare these exact variables, in the order specified, to properly reference the selected entry.  [cautionend]
If the user selects MYLIB2.MYCAT2.MYENTRY2.FRAME in the dialog window and then selects [Advanced], the output for this program is

libref=Mylib2
catalog=Mycat2
entry=Myentry2
type=Frame
('test')[1]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.