01-23-2019
Masande
Fluorite | Level 6
Member since
12-24-2018
- 16 Posts
- 2 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Masande
Subject Views Posted 1788 01-20-2019 09:39 PM 1795 01-20-2019 09:00 PM 1806 01-20-2019 08:32 PM 792 01-07-2019 02:57 PM 820 01-07-2019 12:54 PM 2125 01-06-2019 09:29 AM 2126 01-06-2019 09:25 AM 13198 01-06-2019 09:20 AM 13226 01-05-2019 11:28 PM 2180 01-05-2019 11:19 PM -
Activity Feed for Masande
- Posted Re: Question about (keep=) in DATA statement on New SAS User. 01-20-2019 09:39 PM
- Posted Re: Question about (keep=) in DATA statement on New SAS User. 01-20-2019 09:00 PM
- Posted Question about (keep=) in DATA statement on New SAS User. 01-20-2019 08:32 PM
- Posted Re: Result of input(var1,10.) displaying 3-length values on New SAS User. 01-07-2019 02:57 PM
- Posted Result of input(var1,10.) displaying 3-length values on New SAS User. 01-07-2019 12:54 PM
- Posted Re: Variables values in PDV on New SAS User. 01-06-2019 09:29 AM
- Posted Re: Variables values in PDV on New SAS User. 01-06-2019 09:25 AM
- Posted Re: Oracle VirtualBox 6.0.0 with SAS UE on New SAS User. 01-06-2019 09:20 AM
- Posted Re: Oracle VirtualBox 6.0.0 with SAS UE on New SAS User. 01-05-2019 11:28 PM
- Posted Variables values in PDV on New SAS User. 01-05-2019 11:19 PM
- Liked Re: Questions about Libraries Deletion for SuryaKiran. 01-05-2019 12:28 PM
- Liked Re: Questions about Libraries Deletion for ballardw. 01-05-2019 12:28 PM
- Posted Re: Questions about Libraries Deletion on New SAS User. 01-05-2019 12:27 PM
- Posted Re: Questions about Libraries Deletion on New SAS User. 01-04-2019 03:07 PM
- Posted Questions about Libraries Deletion on New SAS User. 01-04-2019 02:32 PM
- Posted Re: Use 2 dependant variables in a macro/loop on New SAS User. 12-24-2018 02:55 PM
- Posted Re: Use 2 dependant variables in a macro/loop on New SAS User. 12-24-2018 12:55 PM
- Posted Use 2 dependant variables in a macro/loop on New SAS User. 12-24-2018 11:47 AM
-
Posts I Liked
Subject Likes Author Latest Post 3 1
01-20-2019
09:39 PM
I found the quizz here : https://www.analyticsvidhya.com/blog/2017/02/40-must-know-questions-on-base-sas-for-analysts-data-scientists-out-there-skilltest-solution/ The question is the n°17.
... View more
01-20-2019
09:00 PM
I simply copied the question from the quiz without any modification. I hadn't even noticed the 'Actual'd thing. I know what Actual does in yrdiff (alias for "act/act") but never met the "+d" version. So my first question remains, and I can add : "What's "Actual"d ?"
... View more
01-20-2019
08:32 PM
Hello ! I try to solve some quizzes. Considering the following data set : if you submit the following code : data emp(drop=Manager_EMP_ID Salary);
set emp (keep=Manager_EMP_ID Employee_ID Salary);
if Manager_Emp_ID=101 and Salary >45000;
Age = yrdif(DOB,'05Feb2017'd,'Actual'd);
run; Why Employee_ID, Age should be the variables appearing in the emp dataset ? The (keep=) on the lane 2 shouldn't ignore DOB while creating the PDV and so creating an error when reaching the following lane ? Age = yrdif(DOB,'05Feb2017'd,'Actual'd);
... View more
01-07-2019
02:57 PM
I was just trying to manipulate date and conversion. No real objective, just SAS learning.
... View more
01-07-2019
12:54 PM
Considering the following code, data belg;
set belg ;
days=input(date,10.);
run; where date is a numeric, 8 length variable with DDMMYY10. as format/informat. When I run it, days values are displayed in the dataset as 3-digits values. Changing the 10. to 12. allows to display the correct SAS date values (5 digits ones). Why do I need to use a 12. informat while the initial variable is DDMMYY10. and the expected variable have 5-length values ?
... View more
01-06-2019
09:29 AM
If I understand it correctly, the variables i and j are coming from a different data set and their values are retained. sum(i,j) is newly created, hence its value is set to missing. Is that what I'm supposed to see?
... View more
01-06-2019
09:25 AM
According to the Prep Guide, PROC IMPORT runs a DATA step to read the data. Hence the relation with the first post (which is a quote from the book).
... View more
01-06-2019
09:20 AM
I'm sorry but I understood you went from version 5 to version 6. From this perspective, it was possible that the update had reset this setting to its default value.
... View more
01-05-2019
11:28 PM
Did you check if, in Virtual Box, the Read Only check box is not selected? Otherwise, follow these steps: Select Machine > Settings. In the navigation panel, select Shared Folders. Select the shared folder, and click . In the Edit Share window, make sure that the Read Only check box is not selected.
... View more
01-05-2019
11:19 PM
According to the Prep Guide : When PROC IMPORT reads raw data, SAS sets the value of each variable in the DATA step to missing at the beginning of each cycle of execution, with these exceptions: Variables that are named in a RETAIN statement variables that are created in a sum statement Automatic variables In contrast, when reading variables from a SAS data set, SAS sets the values to missing only before the first cycle of execution of the DATA step. Therefore, the variables retain their values until new values become available (for example, through an assignment statement or through the next execution of a SET or MERGE statement). Variables that are created with options in a SET or MERGE statement also retain their values from one cycle of execution to the next. I don't understand this part of the data step execution. For me, with each new iteration, the variables are set to 'missing' for the following code, unless I write "retain total;" or "total+var1;" : data dataset.new;
set dataset.old;
total=sum(total,var1);
run; which is confirmed when I execute the code. However, the bolded part seems to say the opposite, as dataset.old is a SAS data set: the total value shouldn't be reset to missing and var1 would be added to total. While the book has probably no error and the code is executed as I expect, what do I miss about its explanation ?
... View more
01-05-2019
12:27 PM
Thank your for your answers. I understand how librairies work now!
... View more
01-04-2019
03:07 PM
Thank you for your answer. About its first part: does it mean that the library is a logical/non-physical collection of datasets and, if you create some datasets into the lib before deleting it, the datasets will stay but you can't reach/use them anymore with libref.dataset until a new libref poiting towards the folder? In this case, I've got two additional questions: Why does deleting a lib then creating it again will keep the relation between the libref and the data set ? Where is this link stored ? For instance: libname lib2 "/folders/myfolders/";
proc copy in = lib1 out = lib2;
select ds1;
libname lib2 clear; If I create lib2 again, the ds1 copy will stay in "the new" lib2. Where does SAS find the relation between them, even after a session reset ? 2. What would happen in the following case ? libname lib1 "/folders/myfolders/";
libname lib2 "/folders/myfolders/";
proc copy in = lib1 out = lib2;
select ds1;
libname lib2 clear; Both lib being in the same folder and the proc step trying to copy the dataset in the same folder location.
... View more
01-04-2019
02:32 PM
According to the SAS Certification Prep. Guide: When you delete a SAS library, the pointer to the library is deleted, and SAS no longer has access to the library. However, the contents of the library still exist in your operating environment. I have two questions about this statement: What does "the contents of the library still exist in your operating environment" mean in a real situation? What am I suppose to see in SAS Studio and why is their existence important? Is there a difference between deleting a library and cancelling its libref? ( eg. libname libref clear; ) The library manipulations are not clear in my mind and I can't really conceptualize these notions. I think that solving these two points could help me to better understand them. Thank you !
... View more
12-24-2018
02:55 PM
I solved the previous problem with the current code : %macro player(play, dir, out);
data &out;
infile &dir dlm=';' dsd firstobs=2;
input stf :$50. rolb :$50. last_game_date :yymmdd.;
format last_game_date ddmmyy10.;
player=&play;
run;
%mend;
%player("Frank Anderson", "/data/import217_anderson.txt", Player1);
%player("Tom Wilson", "/data/wilson_skj.txt", Player2);
%player("Andrew Pelbigone", "/data/pelbigone_fhz_rtf.txt", Player3); However, it still have some redundancy with the macro call (1 for each player). Can we make it smoother for n players ? It would be pretty tedious for 100 players and it won't solve one part of the initial problem: we don't know the starting player number (and the number of files to convert therefore).
... View more
12-24-2018
12:55 PM
Thank you for your answer. Unfortunately, it doesn't seem to be working. If I launch it once, the data sets are not created (no error in logs) and if I launch it again, log notes give this kind of message : NOTE: The quoted string currently being processed has become more than 262 bytes long. You might have unbalanced quotation marks.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
2 TITLE;
3 FOOTNOTE;
4 OPTIONS LOCALE=en_US DFLANG=LOCALE;
5 DATA _NULL_;
89 &GRAPHTERM; ;*';*";*/;RUN;QUIT;
_________________
49
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.
6 RUN;
7 OPTIONS VALIDVARNAME=ANY;
8 OPTIONS VALIDMEMNAME=EXTEND;
9 FILENAME _HTMLOUT TEMP;
10 FILENAME _RTFOUT TEMP ENCODING='UTF-8';
10 FILENAME _RTFOUT TEMP ENCODING='UTF-8'
_
49
10 ! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended. I tried with the following code too (I think that you made few typos l.1, l.4 and l.9) but the problem remains : %macro player(player=,data=,out=);
data &out.;
infile "&data." dlm=';' dsd firstobs=2;
input stf :$50. rolb :$50. last_game_date :yymmdd.;
format last_game_date ddmmyy10.;
player="&player.";
run;
%mend player;
%macro player(player=Frank Anderson,data=/data/import217_anderson.txt,out=player1);
%macro player(player=Tom Wilson,data=/data/wilson_skj.txt,out=player2);
%macro player(player=Andrew Pelbigone,data=/data/pelbigone_fhz_rtf.txt,out=player3); My (redundant and tedious) code had no problem creating datasets so the input shouldn't be the problem.
... View more