12-20-2024
JohnHoughton
Quartz | Level 8
Member since
11-22-2012
- 68 Posts
- 24 Likes Given
- 15 Solutions
- 33 Likes Received
-
Latest posts by JohnHoughton
Subject Views Posted 1747 03-27-2023 12:31 PM 1695 12-09-2019 05:17 PM 1805 11-16-2019 05:54 AM 1905 11-13-2019 02:14 PM 1039 10-06-2018 02:03 PM 1054 10-06-2018 10:49 AM 2365 05-12-2018 12:03 PM 1043 03-31-2018 09:11 AM 2396 03-29-2018 08:09 AM 2438 03-27-2018 04:20 PM -
Activity Feed for JohnHoughton
- Posted Re: Overal effect test for Categorical variable in PROC MIANALYZE on Statistical Procedures. 03-27-2023 12:31 PM
- Liked Re: delete all data sets in work library except of one data set for Ksharp. 05-17-2021 04:45 AM
- Posted Re: PROC REPORT if a column variable is a statistic name on SAS Procedures. 12-09-2019 05:17 PM
- Posted Re: PROC REPORT if a column variable is a statistic name on SAS Procedures. 11-16-2019 05:54 AM
- Posted PROC REPORT if a column variable is a statistic name on SAS Procedures. 11-13-2019 02:14 PM
- Got a Like for Re: two diagnosis within one year. 08-15-2019 01:10 PM
- Got a Like for Re: Calculating ratio for differenet values in a variable by group. 03-27-2019 12:28 PM
- Got a Like for Re: Code for Interconnecting Two Datasets (Network Construct). 01-22-2019 03:44 AM
- Got a Like for Re: Fill missing values with other values depending on frequency. 10-08-2018 12:17 PM
- Posted Re: Fill missing values with other values depending on frequency on SAS Programming. 10-06-2018 02:03 PM
- Posted Re: Fill missing values with other values depending on frequency on SAS Programming. 10-06-2018 10:49 AM
- Liked Re: read a .csv file in SAS for data_null__. 05-12-2018 12:05 PM
- Liked Re: read a .csv file in SAS for ballardw. 05-12-2018 12:05 PM
- Posted Re: how to import a large .csv file into SAS if it includes the 'extra' comma? on SAS Programming. 05-12-2018 12:03 PM
- Liked Re: Combining character variable into group of variables for Astounding. 04-25-2018 02:55 PM
- Posted Re: input method on SAS Programming. 03-31-2018 09:11 AM
- Posted Re: how to import a large .csv file into SAS if it includes the 'extra' comma? on SAS Programming. 03-29-2018 08:09 AM
- Got a Like for Re: how to import a large .csv file into SAS if it includes the 'extra' comma?. 03-27-2018 05:07 PM
- Posted Re: how to import a large .csv file into SAS if it includes the 'extra' comma? on SAS Programming. 03-27-2018 04:20 PM
- Posted Re: how to import a large .csv file into SAS if it includes the 'extra' comma? on SAS Programming. 03-27-2018 03:22 PM
-
Posts I Liked
Subject Likes Author Latest Post 8 1 1 1 2 -
My Liked Posts
Subject Likes Posted 1 06-30-2016 01:18 PM 1 03-18-2018 12:51 PM 1 03-14-2018 07:38 PM 1 10-06-2018 02:03 PM 2 03-27-2018 03:22 PM
03-27-2023
12:31 PM
The link given to the %COMBCHI macro is not being updated and still points to v1.0. There is an amended formula in version 2.1 of Dr. Paul Allison's %COMBCHI macro from 2007 linked from the "Resources" section of his bio at https://statisticalhorizons.com/our-instructors/paul-allison/
... View more
12-09-2019
05:17 PM
The error in the online help for Proc Report has been corrected now
... View more
11-16-2019
05:54 AM
Thanks ballardw, Looks like I was doing the best thing by renaming the variable then, but explicitly using the define statement is an alternative. @ballardw wrote: First would be why are you creating variables with those names in first place. . . It may just be easier in the long run to quit naming variables with keywords. I didn't create the variable ; SAS did, in an ODS table. My original problem came about because I was using proc report on a data set produced using ODS output from proc mixed, but the ODS table includes the variable StdErr, which is one of the statistic keywords. My fix was to rename StdErr. But the on-line SAS help for proc report gives the impression that there may be another solution. (From "Statistics That Are Available in PROC REPORT") Note: If a variable name (class or analysis) and a statistic name are the same, then enclose the statistic name in single quotation marks (for example, 'MAX' ). But it looks like this proc report help page has been copied from PROC TABULATE without editing the content (the giveaway being it mentions the TABLE statement).
... View more
11-13-2019
02:14 PM
If my dataset variables are the names of statistics (e.g mean min max) , is there no built-in way to use those variables in proc report columns, At the moment I am renaming the variables so they are no longer statistic names. The only reference I've been able to find does the same ,renaming "mean" to "xmean", "std" to "xstd" etc, "so proc report does not get confused"
... View more
10-06-2018
02:03 PM
1 Like
Hi. There was a flaw in the code of my previous post, but here is a fix. Clumsy in places but it works. data have;
input app_id $8. quarter $6.;
datalines;
APP1 2019Q1
APP2 2019Q1
APP3 2019Q1
APP4 2019Q1
APP5 2019Q1
APP6 2019Q1
APP7 2019Q1
APP8 2019Q1
APP9 2019Q1
APP10 2019Q1
APP11 2019Q2
APP12 2019Q2
APP13 2019Q2
APP14 2019Q2
APP15 2019Q2
APP16 2019Q2
APP17 2019Q2
APP18 2019Q2
APP19 2019Q2
APP20 2019Q2
APP21 2019Q2
APP22 2019Q2
APP23 2019Q2
APP24 2019Q2
APP25 2019Q2
APP26 2019Q2
APP27 2019Q2
APP28 2019Q3
APP29 2019Q3
APP30 2019Q3
APP31 2019Q4
APP32 2019Q4
APP33
APP34
APP35
APP36
APP37
APP38
APP39
APP40
APP41
APP42
APP43
APP44
APP45
APP46
APP47
APP48
;
run;
proc sql noprint;
select count(distinct quarter), count(*) /count(distinct quarter) into :Nqtrs,:target from have;
quit;
proc sql;
create table temp_a as
select quarter, count(*) as N
from have
group by quarter
having count(*)<=&target or quarter='';
create table temp_b as
select quarter,
(select sum(N) from temp_a)/(select count (distinct quarter) from temp_a where quarter^='')-N as need ,
(select N from temp_A where quarter='') as available
from temp_a
where quarter ^='';
quit;
data temp_c;set temp_b;
retain cumneed;
if _N_=1 then do;
cumneed=need;
need2=floor(need);
end;
else do;
cumneed=need+cumneed;
end;
cumneed2=floor(cumneed);
need2=cumneed2-lag(cumneed2);
if need2=. then need2=floor(need);
run;
data temp_d (keep=quarter);
set temp_c end=eof;
retain left ;
if _N_=1 then left=available;
do i=1 to need2;
left=left-1;
output;
end;
run;
data temp_e;
set have (where=(quarter=''));
set temp_d;
run;
data want;
set have (where=(quarter^='')) temp_e;
run;
*As a check , compare count from the have and want datasets;
proc sql;
select a.*, b.want from (select h.quarter, count(*) as have from have h group
by h.quarter) a left join
(select w.quarter, count(*) as want from want w group by w.quarter) b on
a.quarter=b.quarter;
quit;
... View more
10-06-2018
10:49 AM
Hi. I've tested this with a few scenarios and it seems to give what you want. I've edited to remove this code. Updated version is in another post (Edit - this had errors so I removed the code)
... View more
05-12-2018
12:03 PM
Hi @France, So did this eventually work when you used the semicolon delimiter?
... View more
03-31-2018
09:11 AM
You will have to base your solution on the fact that there are small number of possible continents. One rudimentary approach is read in entire lines to replace each occurrence of each continent name with a delimited string . For example replace "North America" with ", North America , " Then read the resulting strings as a delimited file.
... View more
03-29-2018
08:09 AM
Ok , so you aren't getting it from Patstat online but on datasets that have been supplied possibly on a memory stick. Try Using Encoding="unicode" option in Infile statement (as in this thread) I've copied below from Patstat documentation which describes the data that I think you are using 2.1. Data files You will find the data files in the folder Data. For every table there is one or more zipped data file(s). To keep all files (if unzipped) smaller than 2 GB, the data of the large tables are split into multiple files. Sometimes users report problems unzipping some files when using WinZip. In these cases it is advisable to try a different unpacking tool like the open source tool 7-zip. After unzipping, each file contains one header record comprising the column names of the table, followed by multiple data records. All characters are in Unicode with UTF-8 encoding The files are in MS-DOS format (i.e. each line ends with CR/LF) Each value is delimited by a comma "," Each string / text value is enclosed in double quotes, like: "Smith, John". Within string values there are never double quotes. All non-text values (numbers, dates) are not enclosed in quotes, like: 123, 2014-12-31 The decimal separator is the point ".", e.g. 0.125 Line breaking characters (LF, CR) are replaced by " \n ". They occur most frequently in the abstract text and the NPL bibliographic text. Except "\n", no other characters are escaped.
... View more
03-27-2018
04:20 PM
Hi @France. Go back to the code you put in the very first post in this thread and change it to use a semi-colon delimiter, DLM=";". This worked for me with the sample table I downloaded from patstat (and attached to earlier message)
... View more
03-27-2018
03:22 PM
2 Likes
To help things along I've registered for patstat and run the following query Select * from tls201_appln where appln_id in (3574782,3897835) UNION SELECT TOP 10 * from tls201_appln where appln_nr_original like '%,%' and appln_nr_original not like '%,' UNION SELECT TOP 10 * from tls201_appln where appln_nr_original not like '%,%' And attached the csv file ... and yes it does contain quotes! (and it's delimited with semi-colons)
... View more
03-24-2018
02:56 PM
Hi @Minutemaid23 Same company , different product. For jmp scripting help , try the jmp community and post a discussion there.
... View more
03-24-2018
04:12 AM
2 Likes
Your code works for me if I just add the out= option and get rid of the bit that says " data kchomes ; run;" proc import datafile="KCHomes.txt" out=kchomes
REPLACE;
DELIMITER='09'x;
GETNAMES=YES;
run;
... View more
03-22-2018
07:50 PM
You can run it in SAS and save the output in a permanent dataset that you then read into JMP. (I'm assuming that you have a SAS license)
... View more
03-21-2018
05:06 PM
2 Likes
But the patstat manual says it can save as xml
... View more