Previous Page | Next Page

SAS Component Language Dictionary

NAMEDIVIDE



Returns the number of parts of a compound name as well as the values of each part
Category: Utility

Syntax
Details
Example
See Also

Syntax

rc=NAMEDIVIDE(name,num-parts, part-1, . . . part-4);

rc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

name

is the name of a two- to four-part compound name to be separated.

Type: Character

num-parts

returns the number of parts in name.

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

Type: Numeric

part-1. . . part-4

contains the values of the first through fourth parts of name.

Note:   These parameters are an update parameters. See Input, Output, and Update Parameters for more information.  [cautionend]

Type: Character


Details

NAMEDIVIDE divides a compound name into parts and returns the number of parts as well as the value of each part.

Note:   NAMEDIVIDE does not validate individual parts of the name.  [cautionend]


Example

Divide NAME into parts and invoke DIALOG if NAME is a FRAME entry. If NAME is not a FRAME entry, CALL DISPLAY.

rc=namedivide(name,parts,part1,part2,part3,part4);
   /* Was NAMEDIVIDE successful? */
if (rc^=0) then do;
   put 'Error: Invalid name ' name;
   return;

type=upcase(part4);
if (part4='FRAME') then
   call dialog(name);
else
   call display(name);


See Also

NAMEMERGE

Previous Page | Next Page | Top of Page