DATA Step, Macro, Functions and more

How to turn a data set into a DATA step program in Base SAS

Reply
Frequent Contributor
Posts: 104

How to turn a data set into a DATA step program in Base SAS

Hi there,

I am trying to create data step program by reading an existing table. Apart from DATA to DATA Step Macro by Jedi, is there any way to address the need. 

 

Thank you in advance for your kind reply.

 

Regards,

 

 
Swain
Super User
Posts: 11,343

Re: How to turn a data set into a DATA step program in Base SAS

Posted in reply to DeepakSwain

Don't know about jedi.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Super User
Posts: 19,780

Re: How to turn a data set into a DATA step program in Base SAS

This code is originally from Mark Jordan aka SAS Jedi. 

 

What specifically about that macro/process doesn't meet your needs? 

 

 

Contributor
Posts: 26

Re: How to turn a data set into a DATA step program in Base SAS

it doesn't work for SAS Studio, is there any other code for Sas studio UE

Super Contributor
Posts: 439

Re: How to turn a data set into a DATA step program in Base SAS

When you say it doesn't work what specifically do you find when you run it because the instructions in the link are clearly for SAS UE?

Super User
Posts: 19,780

Re: How to turn a data set into a DATA step program in Base SAS

[ Edited ]

@bondtk It does work for SAS UE/SAS Studio - I tested it myself, and the instructions are specifically for SAS UE. 

 

 The instructions in Mark (SASJedi) are not for SAS UE but the ones in the link above are.

 

Follow the steps exactly, using the demo as well and get that working, then try it for your own. If you can't get it working then post back with detailed information on what you tried and what did/didn't work.

 

EDIT: please don't add on to a question that's pretty old, feel free to start your own and reference this if necessary.

Contributor
Posts: 26

Re: How to turn a data set into a DATA step program in Base SAS

Hi Reeza

 

It worked , I was confused , I tried to edit the macro , NOW I got it , I need to run the macro so that I stay in the memory and then run the syntax :

 

%DATA2DATASTEP(dataset name,library,file name,obs)

Ask a Question
Discussion stats
  • 6 replies
  • 173 views
  • 1 like
  • 5 in conversation