BookmarkSubscribeRSS Feed
kawakami_densuke_jp
Fluorite | Level 6

Hi,

Do you know how to set Filed attributes in program screen by not manually in attribute window but program code?

I could change color of fields by Fileld function, but could not set Chois groupm, Fomat, Informat, List or and so on.

 

 

 

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

Not quite clear to me what your asking.  If you mean how do you apply properties to variables in code then that is simple:

data <your_library>.<your_dataset>;

  length <your_variable> <your_length>;  /* e.g. avar $4 */

  format <your_variable> <your_format>;  /* e.g. avar best10.*/

  informat <your_variable> <your_format>;

run;

 

Or you can use proc datasets - check the SAS docs.  However you need to be clearer on what software you are using, and what you want to do.

kawakami_densuke_jp
Fluorite | Level 6

Hi, RW9.

Thanks for your reply.

 

I mean follow procedure.

1.Run SAS.

2.Create new catalog "WORK.NEW" in Explorer.

3.Create new entry "Program Screen" in this catalog.

4.Make filed by enter "&TEST".

5.Tools>Filed Attributes>>Attr window is open.

6.You can change attributes by keyboard type or mouse click.

7.I wanna control these attributes by not manually but command.

 

This is a function of SAS AF.

Should I post to another community?

 

Best Regards.


sample.png
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Oh, your using SAS/AF.  Sorry, haven't used that in over 8 years now, surpised anyone is still using it.  Afraid I can't help with that question, and there isn't a forum for it, maybe someone else can help with that.  What are you using it for, there is bound to be better solutions out there.

ballardw
Super User

It has been eve longer for me than for @RW9 using SAS/AF but there were a lot of methods for retrieving and setting properties. Look in the online AF help for _get or _set under methods as a start.

 

Some of what you are doing looks like it might belong in an INIT: code block .

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 795 views
  • 0 likes
  • 3 in conversation