- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am able to create format from dataset with following simple step.
data fmt_cntlin;
set codelist4 (keep= order term rename=(order=start term=label));
fmtname = "myfmt";
run;
proc format cntlin = fmt_cntlin;
run;
Now, I am trying to create informat with similar method. Is it possible to do so with some minor modifications? Maybe some changes in cntlin option or addition of type = 'i' statement after fmtname statement etc.?
Thanks in advance!
- Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes. If you want make a NUMERIC type informat, you need add "type='I'" .
data fmt_cntlin;
set sashelp.class( keep= name age rename=(name=start age=label));
fmtname = "myfmt"; type='I';
run;
proc format cntlin = fmt_cntlin;
run;
data _null_;
set sashelp.class;
fmt=input(name,myfmt.);
put name= age= fmt=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
At the moment, it seems that I was able to solve this by using type = 'j' statement after fmtname statement. I will confirm it soon and will post a confirmed response here.
Thank you.
- Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@DrAbhijeetSafai wrote:
At the moment, it seems that I was able to solve this by using type = 'j' statement after fmtname statement. I will confirm it soon and will post a confirmed response here.
Thank you.
- Dr. Abhijeet Safai
When in doubt do a test.
Make a format (or informat) of the type you want using normal VALUE or INVALUE statement. Then use CNTLOUT= option to make a dataset of the format. Then examine the dataset and see what variables are used and what values they have.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Not "j" but "I" works for informat. Many thanks @Ksharp !
I am replying to my own post for the purpose of documentation. What a wonderful feeling it is to find out your own post some months back and finding answer in it next time when you search about it on the google! 🙂
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes. If you want make a NUMERIC type informat, you need add "type='I'" .
data fmt_cntlin;
set sashelp.class( keep= name age rename=(name=start age=label));
fmtname = "myfmt"; type='I';
run;
proc format cntlin = fmt_cntlin;
run;
data _null_;
set sashelp.class;
fmt=input(name,myfmt.);
put name= age= fmt=;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Ksharp , many thanks! 🙂
- Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real