05-06-2023
japelin
Rhodochrosite | Level 12
Member since
08-15-2018
- 622 Posts
- 59 Likes Given
- 133 Solutions
- 290 Likes Received
-
Latest posts by japelin
Subject Views Posted 2188 10-31-2022 08:40 AM 575 10-26-2022 01:12 AM 671 10-17-2022 01:47 AM 763 09-29-2022 04:43 AM 633 09-29-2022 04:15 AM 1022 09-27-2022 01:05 AM 660 09-19-2022 11:19 PM 692 09-19-2022 11:00 PM 446 09-19-2022 09:41 PM 1397 09-19-2022 09:28 PM -
Activity Feed for japelin
- Got a Like for Re: Como usar API no SAS Enterprise Guide?. 12-04-2023 04:20 PM
- Liked Re: temp sas dataset for SASKiwi. 12-04-2022 11:06 AM
- Posted Re: Reduce run time on SAS Programming. 10-31-2022 08:40 AM
- Posted Re: Wrong command on SAS Programming. 10-26-2022 01:12 AM
- Posted Re: How to find length on SAS Programming. 10-17-2022 01:47 AM
- Got a Like for Re: Creating SAS macro (YYYYMM) based on SAS macro (TIMESTAMP). 09-29-2022 07:10 AM
- Posted Re: Char to numeric on SAS Programming. 09-29-2022 04:43 AM
- Posted Re: Creating SAS macro (YYYYMM) based on SAS macro (TIMESTAMP) on SAS Programming. 09-29-2022 04:15 AM
- Posted Re: Sort by datetime on SAS Programming. 09-27-2022 01:05 AM
- Got a Like for Re: Protecting data sets using read/write/alter syntax or is there a better option?. 09-21-2022 12:50 PM
- Posted Re: Grouping data on SAS Programming. 09-19-2022 11:19 PM
- Posted Re: Grouping data on SAS Programming. 09-19-2022 11:00 PM
- Posted Re: How to code this column (point)? on SAS Programming. 09-19-2022 09:41 PM
- Posted Re: Protecting data sets using read/write/alter syntax or is there a better option? on SAS Programming. 09-19-2022 09:28 PM
- Posted Re: data flow on SAS Programming. 09-15-2022 11:50 PM
- Posted Re: data flow on SAS Programming. 09-15-2022 11:08 PM
- Posted Re: programming help on SAS Programming. 09-15-2022 04:58 AM
- Posted Re: programming help on SAS Programming. 09-15-2022 04:25 AM
- Posted Re: Data _null_ on SAS Programming. 09-15-2022 04:12 AM
- Posted Re: combine date +time into one field on SAS Programming. 09-15-2022 03:57 AM
-
Posts I Liked
Subject Likes Author Latest Post 2 1 6 2 3 -
My Liked Posts
Subject Likes Posted 1 09-29-2022 04:15 AM 1 09-19-2022 09:28 PM 1 08-29-2022 11:55 AM 1 08-31-2022 02:45 AM 1 08-25-2022 03:48 AM
10-31-2022
08:40 AM
Maybe Way1 is faster, but why don't you try it anyway?
Also...try
-Increase MEMSIZE and REALMEMSIZE allocations.
-Use TAG sorting.
-Get better hardware.
... View more
10-26-2022
01:12 AM
First, run "options mprint symbolgen;" to get the command string that resolve the macro variable and check if it executes correctly as a command.
Note that the command presented will not be moved or renamed since the first and second parameters are the same file path.
... View more
10-17-2022
01:47 AM
Since the num variable in the ds data set is a numeric variable, the length of a string cannot be obtained. If it is treated as a character variable, the length can be obtained as follows.
data ds;
length num $20;
input num $;
cards;
1234567891
12345678901
run;
data _null_;
set ds;
len=length(num);
put len=;
run;
Or, if you want to treat them as numbers, you can convert them to charactors.
data ds;
input num;
cards;
1234567891
12345678901
run;
data _null_;
set ds;
len=length(strip(put(num,best12.)));
put len=;
run;
... View more
09-29-2022
04:43 AM
how about this.
data test;
SKUNEW='002500000000011205';
SKUNEW2=input(SKUNEW,20.);
format SKUNEW2 20.;
run;
... View more
09-29-2022
04:15 AM
1 Like
Since neither put nor input function can be used in %sysfunc, it may be easier to use the data step as follows.
%let PrevPeriod_dttm='31AUG2022:23:59:59'dt;
data _null_;
call symputx('PrevPeriod_yyyymm',put(datepart(&PrevPeriod_dttm),yymmn6.));
run;
%let PrevPeriod_mm = %sysfunc(putn(%sysfunc(inputn(&PrevPeriod_m., best2.)), z2.));
... View more
09-19-2022
11:19 PM
If you say "exclude those id's from dataset one, having description 'def'", isn't it the following data? 03 lkm 03 ghi 03 opq 03 rst 04 abc 04 opq 04 xyz
... View more
09-19-2022
11:00 PM
I don't use either "first." or "last." but how about this simple way of writing?
data have;
length id $2 desc $3;
input id $ desc $;
cards;
01 abc
01 def
01 ghi
01 xyz
02 def
02 ghi
02 xyz
03 lkm
03 ghi
03 opq
03 rst
04 abc
04 opq
04 xyz
;
run;
data one two;
set have;
if desc='def' then output one;
else output two;
run;
proc sql;
create table one as
select * from have
where desc='def';
create table two as
select * from have
where desc^='def';
quit;
... View more
09-19-2022
09:41 PM
I assume it is sorted by cust_no obs_window.
data mydataset;
set have;
by cust_no obs_window;
if first.obs_window then point = 0;
else point +1;
run;
... View more
09-19-2022
09:28 PM
1 Like
1) That's odd. I could not identify any such problem with password and read. The following code works fine.
data pw1(read=a write=b alter=c);
a=1;
run;
data pw1_2;
set pw1(pw=a);
run;
data pw2(pw=a);
a=1;
run;
data pw2_2;
set pw2(read=a);
run;
2)To what extent should the data be password protected? If it is a normal password, it is easily accessible in python or R. It is protected only "on SAS".
However, I can see how a write and ALTER password would give you peace of mind that the original data set will not be edited. In such cases, data sets in an appropriate access environment may be provided with the read password removed.
In such a data set, both the read and password options can be accessed with or without the read option, even if the password specified is incorrect.
data class(write=abc alter=xyz);
set sashelp.class;
run;
data read1;
set class;
run;
data read2;
set class(read=xxxxx);
run;
data read3;
set class(pw=abcdefg);
run;
... View more
09-15-2022
11:50 PM
It is advisable to abandon the idea of changing a program in an environment where testing is not possible. Whether it is Oracle or SAS, some problems can occur, so a situation where there is no test environment is not very desirable. First, consider creating a test environment.
I think the most effective way to deal with the current situation is to understand not overview but details of the program.
... View more
09-15-2022
11:08 PM
I don't think you can do anything without understanding overview of each process in the program. And I think some trial and error is in order. 1. Decide "what is absolutely necessary". 2. Try trimming dataset. 3. Submit program step by step and compare trimed dataset with whole dataset to check the impact on results.
... View more
09-15-2022
04:58 AM
use %str or %nrstr for special charactor.
for example
%Macro Mtest(val);
data sample;
a="&val";
run;
proc print;run;
%Mend;
%Mtest(xxx,yyy)/* error */
%Mtest(%str(xxx,yyy))
... View more
09-15-2022
04:12 AM
I recommend to review the documentasion first.
https://documentation.sas.com/doc/en/lrcon/9.4/n0elquksqmdambn11jprcl6d1fxw.htm#n1q67b96axz10dn14y1pkcjunlcd
> What does this do? Since no output dataset or temp dataset saved, does it changing the content of txt file?
The text file is rewritten because it is put into the file specified in the file statement.
> Does variable cmsdate still exist in the system after this program is run?
No dataset is generated, so no variables exist.
... View more