DATA Step, Macro, Functions and more

How to update the format name?

Reply
Super Contributor
Posts: 617

How to update the format name?

I'm trying to update the dataset where the below fmtname has stored. I don't know which dataset  (I know the library though)has the format definition. when I execute the below code, it has 0 observations.

 

proc sql;
   create table myfmts as
   select fmtname,libname, memname
   from dictionary.formats
   where fmtname in ('$VA_MAKPRD' '$VA_LEADACTIE_SUBGRP')
   ;
quit;

When I execute the below code, I could see the dataset which I need to update. But 'formats' is not the actual dataset which I need to update. It is just a temporary dataset which I used to see the dataset. Appreciate if someone of you guide me to see the  actaul dataset which I need to update.

 

proc format library=it_rci_s.formats cntlout=work;
run;
Super User
Posts: 10,610

Re: How to update the format name?

You already have FORMAT information in table WORK.

modify table WORK. and update FORMAT by 

 

proc format library=it_rci_s cntlin=work;
run;
Super Contributor
Posts: 617

Re: How to update the format name?

If I change the dataset name from Work to Employee, will it create a
Employee dataset in the library as you mentioned below?


Super User
Posts: 13,000

Re: How to update the format name?


@Babloo wrote:
If I change the dataset name from Work to Employee, will it create a
Employee dataset in the library as you mentioned below?



If you are referring to proc format the data set name on the CNTLOUT option is created then the name you supply follows normal SAS rules. If you want the cntlout in that library you have to use cntlout=library.employee, otherwise it will write to WORK or USER.

 

Since cntlout will write the information about all formats in the catalog to cntlout by default you might be wanting to add a SELECT statement to only include specific format(s) to the output.

Super Contributor
Posts: 617

Re: How to update the format name?

Whether I have to use the select statement after writing the Proc format?
Appreciate if you could help me with the code snippet.
Super User
Posts: 10,610

Re: How to update the format name?

Table EMPLOYEE will still be in WORK library .

proc format just update original format by table EMPLOYEE.

Ask a Question
Discussion stats
  • 5 replies
  • 71 views
  • 3 likes
  • 3 in conversation