bakul shah


{ City } franklin park
< Country > usa
* Profession * retiree
User No # 30362
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 8
Users Marked my Answers as Wrong # 1
Questions / { bakul shah }
Questions Answers Category Views Company eMail




Answers / { bakul shah }

Question { 14237 }

Have you ever linked SAS code, If so, describe the link and
any required statements used to either process the code or
the step itself?


Answer

Another way to call Subroutine.
Example:
*========================================================
* Bakul Shah
* HOW MANY DIFFERENT WAYS IT IS POSSIBLE TO MAKE
* CHANGE FOR A DOLLAR? ---> 292 Posibilities ??
*
* H HALF DOLLAR
* Q QUARTER
* D DIME
* N NICKEL
* P PENNY
* A LOOP - INITIALIZE TO ZERO
* NO LINE NUMBER - INITIALIZE TO 55
* KOUNT TOTAL NUMBER INITIALIZE TO ZERO
* ;

/* The file 'c:coinpage.txt' is:
File Name=C:\WINDOWS\system32\coinpage.txt,
RECFM=V,LRECL=256 */

Data Null_ ;
/* file 'c:coinpage.txt'; */
File CoinPage ;
A=0 ;
PageCount = 0 ;
NO=55; Retain NO;
KOUNT=0;
DO H = A to 2; /* Half Dollar */
DO Q = A to 4; /* Quarter */
DO D = A to 10; /* Dime */
DO N = A to 20; /* Nickle */
DO P = A to 100; /* Cents */
IF(((H*50)+(Q*25)+(D*10)+(N*5)+P)=100) THEN
do;
KOUNT+1 ;
If NO > = 55 then
do;
Link PageHeader;/* Calling Subroutine*/
end;
NO+1 ;
Put @9 KOUNT 3. @18 H 3. @27 Q 3.
@36 D 3. @45 N 3. @54 P 3. ;
end;
end;
end;
end;
end;
end;
Return;

PageHeader: /* Subroutine */
PageCount + 1 ;
Put @70 'Page' +0 PageCount 2.
/@8 'KOUNT' @20 'H' @29 'Q' @38 'D'
@47 'N' @56 'P' ;
NO = 0 ;
Return;
Run;

Is This Answer Correct ?    2 Yes 1 No

Question { 7218 }

In a shcool there are 1000 students. After completion of
every test in 6 subjects , each subject teacher submit the
marks of every student at different times and loaded in the
database commonly. How will you seperate the top two
subject marks for each each studet using SAS?


Answer

/*
Bakul Shah
6/May/2009
*/
Data A ;
Array N{6};
Input Name $ N{*} ;
Call SortN(of N{*}); /* Sort for Intergers */
Put @5 Name $ @10 N{6} 3. +2 N{5} 3.;/* 6th and 5th */
DataLines;
David 76 81 65 87 78 98
Manisha 100 91 67 86 87 81
Bob 83 93 76 88 96 72
;
Run;
*;

Is This Answer Correct ?    6 Yes 0 No