Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mcf_length.sas File Reference

Returns the length of a numeric value. More...

Go to the source code of this file.

Detailed Description

Returns the length, in bytes, of a numeric value. If the value is missing, then 0 is returned.

The function itself takes the following (positional) parameters:

PARAMETER DESCRIPTION
var variable (or value) to be tested

Usage:

%mcf_length(wrap=YES, insert_cmplib=YES)

data _null_;
  ina=1;
  inb=10000000;
  inc=12345678;
  ind=.;
  outa=mcf_length(ina);
  outb=mcf_length(inb);
  outc=mcf_length(inc);
  outd=mcf_length(ind);
  put (out:)(=);
run;

Returns:

‍outa=3 outb=4 outc=5 outd=0

Parameters
[out]wrap=(NO) Choose YES to add the proc fcmp wrapper.
[out]lib=(work) The output library in which to create the catalog.
[out]cat=(sasjs) The output catalog in which to create the package.
[out]pkg=(utils) The output package in which to create the function. Uses a 3 part format: libref.catalog.package
[out]insert_cmplib=DEPRECATED - The CMPLIB option is checked and values inserted only if needed.

SAS Macros

Related Programs

Definition in file mcf_length.sas.