BookmarkSubscribeRSS Feed
ren2010
Obsidian | Level 7
Hi,

I have a new patient dataset where patient num(numeric field) is in format 11 and informat 11
but recently the team who provides the patient dataset created new patient dataset and the patient num is in format 2O AND informat 20.

but when i create another version of new patient dataset i want to use patient num in format 11 and informat 11.
i use sql to create another version of new patient dataset,and i use like this
proc sql;
create table newver as select patnum format 11. from newpat ;
quit;

My question is what if i do not change the informat here?
Can any one help?
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The associated INFORMAT is only used when no INFORMAT is named on an INPUT statement. You will need to review the SAS program that loads your input data for a specified or implied INFORMAT definition. DOC link provided below for INFORMAT statement:

http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000178244.htm


Scott Barry
SBBWorks, Inc.
Flip
Fluorite | Level 6
The format and informat is not a problem. What I would worry about given your statement is the length of the variable. Make sure you are not truncating the new data to fit it into 11.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Though not mentioned by the OP, a declared LENGTH attribute (ATTRIB or LENGTH statement) "may" affect the SAS NUMERIC variable resolution in a subsequent DATA/PROC step, if the SAS variable is kept.

However, most definitely if an INFORMAT is used on an INPUT statement, there also may be incorrect data interpretation.

Scott Barry
SBBWorks, Inc.


33 data x;
34 length a 4;
35 format a 14.4;
36 input a ;
37 putlog _all_;
38 cards;

a=22212.2222 _ERROR_=0 _N_=1
NOTE: The data set WORK.X has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds


40 run;
41 data _null_;
42 set ;
43 putlog _all_;
44 run;

a=22212.2188 _ERROR_=0 _N_=1
NOTE: There were 1 observations read from the data set WORK.X.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.00 seconds Message was edited by: sbb

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1684 views
  • 0 likes
  • 3 in conversation