Learn R Programming

icd9 (version 1.3.1)

sasFormatExtract: extract assignments from a SAS FORMAT definition.

Description

this is modelled entirely on a single chunk of SAS code, but hopefully will have some generalizability. It relies heavily on lists and regex, but, as you will see from the code, R is not a great language with which to write a SAS parser.

Usage

sasFormatExtract(sasTxt)

Arguments

sasTxt
is a character vector, with one item per line, e.g. from readLines

Value

list (of lists)

References

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473474.htm https://communities.sas.com/thread/47571?start=0&tstart=0 https://communities.sas.com/message/165945

Examples

Run this code
  ## Not run: 
#   sasFormatExtract(readLines('inst/extdata//comformat2012-2013.txt'))
#   ## End(Not run)

Run the code above in your browser using DataLab