BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
"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
deleted_user
Not applicable
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 654 views
  • 0 likes
  • 2 in conversation