Chapter Contents |
Previous |
Next |
DSID |
Category: | SAS Table |
Syntax | |
Details | |
Examples | |
Example 1: Working with Several Tables | |
Example 2: Returning the DSID of a Generation Data Set | |
See Also |
Syntax |
dsid=DSID(<table-name<,mode<,nth<,gen-num>>>>); |
0 | if the table is not currently open, if the table is not open in the requested mode, or if no nth open occurrence exists. |
<0 | if an error occurs. SYSMSG contains the error text. |
Type: Numeric
Type: Character
'I' |
INPUT mode, allows random access if the engine supports it; otherwise, defaults to IN mode. |
'IN' |
INPUT mode, reads sequentially and allows revisiting rows. |
'IS' |
INPUT mode, reads sequentially but does not allow revisiting rows. |
'N' |
NEW mode, creates a new SAS table. |
'U' |
UPDATE mode, allows random access if the engine supports it; otherwise, defaults to UN mode. |
'UN' |
UPDATE mode, reads sequentially and allows revisiting rows. |
'US' |
UPDATE mode, reads sequentially but does not allow revisiting rows. |
'V' |
UTILITY mode, allows modification of column attributes and indexes that are associated with the SAS table. |
Type: Character
Type: Numeric
Type: Numeric
Details |
DSID searches all SAS tables that are currently open. This function is useful for accessing table identifiers across entries.
Examples |
Open several SAS tables and find the first occurrence in various modes:
/* Open several SAS tables, varying the open mode */ dsid1 = open('sasuser.class', 'I'); dsid2 = open('sasuser.class', 'U'); dsid3 = open('sasuser.class', 'U'); dsid4 = open('sasuser.houses', 'U'); dsid5 = open('sasuser.class', 'I'); dsid6 = open('sasuser.houses', 'U'); dsid7 = open('sasuser.houses', 'I'); dsid8 = open('sasuser.class', 'U'); /* Find the first occurrence open in any mode.*/ first = DSID( 'sasuser.houses' ); put first=; /* Find the first occurrence open in 'I' */ firstI = DSID( 'sasuser.houses', 'I' ); put firstI=; /* Find the second occurrence open in 'I' */ secondI = DSID( 'sasuser.class', 'I', 2 ); put second=; /* Return the fourth occurrence open in 'U' */ secondU = DSID( 'sasuser.class', 'U', 4 ); put secondU=;This example produces the following output:
first=4 firstI=7 secondI=5 secondU=0
The following code returns the DSID of the SAS table WORK.ONE#003.
dsid=DSID(`work.one',`IN',1,3);
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.