Looks up an INVALUE format by name from the global format library and applies it to convert labels to character values.
Examples
# Bidirectional: use finputc for reverse direction
fnew_bid(
"A" = "Active",
"I" = "Inactive",
"P" = "Pending",
name = "status"
)
#> $format
#> KS Format:status
#> Type: character
#> Mappings:
#> A => Active
#> I => Inactive
#> P => Pending
#>
#> $invalue
#> KS Invalue: status_inv
#> Target Type: character
#> Mappings:
#> Active => A
#> Inactive => I
#> Pending => P
#>
# Forward: code -> label
fputc(c("A", "I", "P"), "status")
#> [1] "Active" "Inactive" "Pending"
# [1] "Active" "Inactive" "Pending"
# Reverse: label -> code
finputc(c("Active", "Pending", "Inactive"), "status_inv")
#> [1] "A" "P" "I"
# [1] "A" "P" "I"
fclear()
#> All formats cleared from library.