4 weeks ago
qinghe
Calcite | Level 5
Member since
01-10-2016
- 11 Posts
- 0 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by qinghe
Subject Views Posted 295 04-10-2025 06:52 PM 467 04-09-2025 10:52 PM 483 04-09-2025 10:10 PM 4157 08-07-2017 12:12 AM 3093 07-06-2017 07:54 PM 1307 01-18-2016 10:45 PM 1775 01-13-2016 07:25 PM 1782 01-13-2016 07:00 PM 1785 01-13-2016 06:47 PM 5265 01-11-2016 12:06 AM -
Activity Feed for qinghe
- Posted Re: ERROR: PUT function reported 'ERROR: Invalid value for width specified - width out of range' whi on SAS Programming. 04-10-2025 06:52 PM
- Posted Re: ERROR: PUT function reported 'ERROR: Invalid value for width specified - width out of range' whi on SAS Programming. 04-09-2025 10:52 PM
- Posted ERROR: PUT function reported 'ERROR: Invalid value for width specified - width out of range' while p on SAS Programming. 04-09-2025 10:10 PM
- Posted WARNING: Iteration limit exceeded. on Statistical Procedures. 08-07-2017 12:12 AM
- Posted full join proc sql on SAS Programming. 07-06-2017 07:54 PM
- Posted Values of a numeric variable are not recognised by SAS on SAS Programming. 01-18-2016 10:45 PM
- Posted Re: error with macro on SAS Programming. 01-13-2016 07:25 PM
- Posted Re: error with macro on SAS Programming. 01-13-2016 07:00 PM
- Posted error with macro on SAS Programming. 01-13-2016 06:47 PM
- Posted Re: Invalid argument to function ... on SAS Programming. 01-11-2016 12:06 AM
- Posted Invalid argument to function ... on SAS Programming. 01-10-2016 11:55 PM
04-10-2025
06:52 PM
Thanks a lot. It's very helpful!
... View more
04-09-2025
10:52 PM
Hi, I am sorry that there is a typo in the program: "select * from test" should be "select * from A" Regards, Qinghe
... View more
04-09-2025
10:10 PM
Hi, I want to know how to solve the error " Invalid value for width specified" in the following program: data A; input record_id name $ mark; cards; 1100111 A 99 1100112 B 78 2100111 C 60 2100100 D 78 2100112 E 91 3100111 F 40 3011112 G 36 ; data B (rename=(record_id=start)); retain fmtname "select" label "A"; set test; where mod(record_id,10) in (0, 1); run; proc format cntlin=B; run; proc sql; create table A_selected as select * from test where put(record_id, select.)="A"; quit; I can get the correct output, but with error messages. Thank you in advance. Qinghe
... View more
08-07-2017
12:12 AM
Hi, I am running GENMOD. It gives me a warning as below: WARNING: Iteration limit exceeded. The outcome results look unreasonable. What can I do? Best regards, Qinghe Yin WARNING: Iteration limit exceeded.
... View more
07-06-2017
07:54 PM
Hi, I find that in proc sql the "full join" of 2 sets depends on the order. I did the following experiement: data a; do i=1 to 2; x="a"; output; end; data b; do i=2 to 3; y="b"; output; end; proc sql; create table a_full_join_b as select * from a full join b on a.i=b.i; run; proc sql; create table b_full_join_a as select * from b full join a on a.i=b.i; run; The results are as blow: a_full_join_b: 1 1 a 2 2 a b 3 . b b_full_join_a: 1 . a 2 2 b a 3 3 b What I want is: 1 1 a 2 2 a b 3 3 b How I get it with proc sql? I know that in this particular case we can use merge. but my real problem is many to many. merge does not work well. Thanks a lot. Qinghe
... View more
01-18-2016
10:45 PM
Hi there, Below is my program: data hosp_proc12a; merge hosp12 (in=a) procd; by record_id; if a; if procedure_no=. then procedure_no=0; else if 5 <= procudure_no <=9 then procudure_no =5; else if procudure_no >=10 then procudure_no=10; keep record_id indig procedure_no age_grp; run ; For missing value, I can get a 0. but for other values, there is no change at all. I still have values like 8, 11, 13, 18 in there. I tried to to define a new variable: data hosp_proc12a; merge hosp12 (in=a) procd; by record_id; if a; if procedure_no=. then procd_no=0; else if 1 <= procudure_no <=4 then procd_no =procudure_no ; else if 5 <= procudure_no <=9 then procd_no =5; else if procudure_no >=10 then procud_no=10; keep record_id indig procedure_no age_grp; run ; But this time I can only get procd_no=0 when procedure_no is missing and procd_no is missing when procedure_no take other values. Why this can happen? WHat I need to do? Qinghe
... View more
01-13-2016
07:25 PM
Hi Reeza This is not the only error. The macro %to does not accept 5, 10. For 10 I have to do it seperately. You are right, use array should be easier. Thanks. Qinghe
... View more
01-13-2016
06:47 PM
Hi there, I have got the following error message: "557: LINE and COLUMN cannot be determined. NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred. ERROR 557-185: Variable fisrt is not an object. ERROR: DATA STEP Component Object failure. Aborted during the COMPILATION phase. NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 131.12k OS Memory 14892.00k Timestamp 01/14/2016 10:32:49 AM ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: 5, 10 ERROR: The %TO value of the %DO I loop is invalid. ERROR: The macro HP3067 will stop executing." The macro is as belw: %macro HP3067(yr1, yr2, yr3); data HP; set hosp_proc&yr2 hosp_proc&yr3; %sort(HP, Indig); data HP; set HP; by indig; if fisrt.indig then do; %do i=1 %to 5, 10; p&i=0; %end; total=0; end; total+1; %do i=1 %to 5, 10; if procedure_no=&i then p&i+1; %end; %do i=1 %to 5, 10; pct&i=p&i/total* 100; %end; pt=100; if last.indig then output; run; %mend; Anyone can tell me what I did wrong? Thanks. qinghe
... View more
01-10-2016
11:55 PM
Hi, I have got the following information in the log: NOTE: Invalid argument to function YRDIF at line 21 column 18. NOTE: Invalid second argument to function SUBSTR at line 26 column 9. NOTE: Invalid second argument to function SUBSTR at line 27 column 9. The lines 21 to 27 ar as below: 21 age_at_131015 = yrdif(birth_date, '13oct2015'd, 'act/act'); 22 if age_at_131015 <5 then age_grp="0-4"; 23 else if age_at_131015 <15 then age_grp="5-14"; 24 else age_group="15+"; 25 if substr(Indigenous_status, 1, 1)="A" or substr(Indigenous_status, 1, 1)="T" then Indig=1; 26 else if substr(compress(Indigenous_status), 1, 4)="NOTA" then Indig=2; 27 else if substr(compress(Indigenous_status), 1, 4)="NOTS" then Indig=9; What I did wrong? Thanks. qinghe
... View more