-1

I am trying to create a simple SAS program which looks like below,

student_id = 123;
class_id   = 123;
name       = 'John';

How can I use another SAS code to automatically generate a SAS program contains as simple contents as shown above? Thanks a lot.

1 Answers1

0

Any SAS Macro is doing exactly that, generating code.

%macro run_my_code;
student_id = 123;
class_id   = 123;
name       = 'John';
%mend run_my_code;

%run_my_code;

If you want something more specific than that, though, you're going to have to give a more specific question.

Joe
  • 62,789
  • 6
  • 49
  • 67
  • Thank you so much for your answer, I am actually trying to create a program A that assigns value to variables such as 'student_id', 'class_id' and 'name' and put the result in another program B as – Chunyang Zheng Oct 14 '16 at 14:01
  • student_id = 123; class_id = 123; name = 'John'; Then I have program C to %include program B into it by the name of program B. – Chunyang Zheng Oct 14 '16 at 14:03