BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

Please assist or point me to some good examples for working with OS commands and converting those results into usable SAS dataset results. 

What I am trying to do is work with SAS and the OS commands to review changes in programs and data over time which works as expected to this point.  What I am expecting is a SAS dataset for each time that contains results from changes found by the OS command output results contains information.   the information is used after this process but currently I am saving the SAS log as text and working with that.

This is the macro produces and an example of the output from a SAS log after the macro has been called included under the macro below.

%macro changed_sas;
 data _null_;
  infile oscmd;
  input;
  put _infile_;
 run;
%mend changed_sas;

 

***** C:\TEST\CREATE.SAS

   74:

   75:  %let Month1 = 200001;

   76:  %let MonthN = 201803;

   77:  %let update = D;

   78:

***** D:\TEST\CREATE.SAS

   74:

   75:  %let Month1 = 200001;

   76:  %let MonthN = 201712;

   77:  %let update = N;

   78:

*****

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

thank you everyone

I needed to replace _null_ with a name and then put statement needed to be replaced with myvar.

data test;

infile oscmd;

input;

 

myvar= _infile_;

run;

 

View solution in original post

4 REPLIES 4
Reeza
Super User
Rather than build your own version control system can you use Git or an established version control system? There are several log and code parsers available from users, if you check lexjansen.com and there's also PROC SCAPROC to trace procedures.
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

What I am expecting is the results in a SAS dataset's based on SAS calling OSCMD and getting output resulted from the DOS command such as FC, DIR ...  As an example.  I know that GIT works, but what I am looking for is analyzable SAS datasets that are results which are due to changes in SAS programs and SAS datasets, underplaying depended documents related to policies and such over a long time period that involves many changes to each program area under evaluation.

 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

thank you everyone

I needed to replace _null_ with a name and then put statement needed to be replaced with myvar.

data test;

infile oscmd;

input;

 

myvar= _infile_;

run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2027 views
  • 0 likes
  • 3 in conversation