F$CUNITS

From VSI OpenVMS Wiki
Revision as of 08:36, 5 April 2019 by Darya.zelenina (talk | contribs) (Created page with "'''F$CUNITS''' is a lexical function that converts values between blocks, bytes, kilobytes, megabytes, gigabytes, and terabytes. =Syntax= F$CUNITS(num...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

F$CUNITS is a lexical function that converts values between blocks, bytes, kilobytes, megabytes, gigabytes, and terabytes.

Syntax

F$CUNITS(number [,from-units, to-units])

from-units:

  • BLOCKS
  • B
  • KB
  • MB
  • GB
  • TB

to-units:

  • BLOCKS
  • BYTES (supported only for BLOCKS to BYTES conversions)
  • B
  • KB
  • MB
  • GB
  • TB

Example

$ WRITE SYS$OUTPUT F$CUNITS(1024)
512KB

$ WRITE SYS$OUTPUT F$CUNITS(1024, "BLOCKS")
512KB

$ WRITE SYS$OUTPUT F$CUNITS(1024, "BLOCKS", "BYTES")
512KB

$ write sys$output f$cunits(512,"bytes","blocks")
%DCL-W-CONFLICT, illegal combination of command elements - check documentation
 \BYTES\

$ write sys$output f$cunits(512,"b","blocks")
1BLOCKS

$ write sys$output f$cunits(10000,"blocks","gb")
0GB