Hello,
I have a dataset with 100 records which are basically the LAN_IDs of users. I want to know what all AD groups they're in. I basically run, id lan_id from the Linux command line. I hate doing that for all the 100 users.
How do I succeed using XCMD programmatically from Enterprise Guide?
Please suggest!
TIA,
Akshay.
Then you can use the "magic dynamic pipe":
data usernames;
input name $8.;
datalines;
lan_id
;
data userdata;
set usernames;
length pipevar $20;
pipevar = "id " !! name;
infile dummy pipe filevar=pipevar end=done;
do until (done);
input uidstring :$20. gid_string :$20. group_string :$500.;
output;
end;
run;
This algorithm is part of a presentation planned for SASGF 2021 in Las Vegas.
The option xcmd must be enabled on the workspace-server you are using. If is is enabled, you can use filename with pipe to execute a command an process the result using a data-step.
Do you have a dataset with the usernames?
Then you can use the "magic dynamic pipe":
data usernames;
input name $8.;
datalines;
lan_id
;
data userdata;
set usernames;
length pipevar $20;
pipevar = "id " !! name;
infile dummy pipe filevar=pipevar end=done;
do until (done);
input uidstring :$20. gid_string :$20. group_string :$500.;
output;
end;
run;
This algorithm is part of a presentation planned for SASGF 2021 in Las Vegas.
You're A W E S O M E!
It worked. Thanks a lot.
The XCMD option can only be set as an option when you start SAS so it can't be done in EG. Your SAS Administrator can set it via SAS Management Console or a SAS config file.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.