Macros for SAS Application Developers
https://github.com/sasjs/core
mp_base64copy.sas File Reference

Convert a file to/from base64 format. More...

Go to the source code of this file.

Detailed Description

Creates a new version of a file either encoded or decoded using Base64. Inspired by this post by Michael Dixon: https://support.selerity.com.au/hc/en-us/articles/223345708-Tip-SAS-and-Base64

Usage:

  filename tmp temp;
  data _null_;
    file tmp;
    put 'base ik ally';
  run;
  %mp_base64copy(inref=tmp, outref=myref, action=ENCODE)

  data _null_;
    infile myref;
    input;
    put _infile_;
  run;

  %mp_base64copy(inref=myref, outref=mynewref, action=DECODE)

  data _null_;
    infile mynewref;
    input;
    put _infile_;
  run;
Parameters
[in]inref=(0) Fileref of the input file (should exist)
[out]outref=(0) Output fileref. If it does not exist, it is created.
[in]action=(ENCODE) The action to take. Valid values:
  • ENCODE - Convert the file to base64 format
  • DECODE - Decode the file from base64 format
Version
9.2
Author
Allan Bowe, source: https://github.com/sasjs/core

SAS Macros

Definition in file mp_base64copy.sas.