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;

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1024 views
  • 0 likes
  • 3 in conversation