Help using Base SAS procedures

Replacing PROC FORMAT INVALUE with sequential dataset

Reply
N/A
Posts: 0

Replacing PROC FORMAT INVALUE with sequential dataset

I need to replace an existing INVALUE with a sequential dataset, and do not have clue 1 on how to do this. I am working with SAS 9.1.3 on a z/OS. The existing code looks like this:

PROC FORMAT;
INVALUE $FEIN '530075853' = '01'
'521264413' = '02'
'751588101' = '03'
'520794134' = '06';

and is then used in an INPUT statement:
DATA LIAB;
INFILE INPUT01;
INPUT @1 COMP $FEIN.
@13 LOB $CHAR1. ;

after the INPUT is the following:
KEEP COMP LOB;

The input file will only have 5 or 6 records.

Any thoughts or suggestions will be greatly appreciated

Thx
Super Contributor
Super Contributor
Posts: 3,174

Re: Replacing PROC FORMAT INVALUE with sequential dataset

"Replace with sequential dataset" - what does this mean? Do you want to eliminate the use of the INPUT/INFORMAT $FEIN and change the SAS code to somehow take the possible input/output data-values and maintain then in a sequential file?

And, if so, would you expect your SAS program to read the sequential file with each execution, take the current data-values and generate your SAS statements to perform the data translation?

Have you looked at PROC FORMAT and CNTLIN= where you would have a DATA step to read your external (sequential) file and generate the SAS-required variables needed to use PROC FORMAT and input your equivalent INVALUE parameters from a SAS file?

Suggest reviewing the SAS DOC for PROC FORMAT (not having to do with z/OS specifically, other than reading / inputting your external file).

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

proc format cntlin invalue site:sas.com
N/A
Posts: 0

Re: Replacing PROC FORMAT INVALUE with sequential dataset

Scott,

You are correct in your assumptions - the sequential dataset IS intended to replace the hard-coded values. I have not worked with PROC FORMAT before, but I will give your suggestion a try and let you know how it works. Your help is greatly appreciated - I know only a little SAS, so did not know where to even start looking for the answer..

Thanks,
GES60
Ask a Question
Discussion stats
  • 2 replies
  • 106 views
  • 0 likes
  • 2 in conversation