Thursday, October 21, 2010

SAS REPORTER: STARTING WITH HASH-OBJECTS PROGRAMMING-:

SAS REPORTER: STARTING WITH HASH-OBJECTS PROGRAMMING-:

STARTING WITH HASH-OBJECTS PROGRAMMING-:

/*what--learning to apply hash programming concept*/
/*how--we create two datasets master and details.We need to lookup values
from the details ds and include a column into master based on some key variable
that exists in both the ds*/

data master;
infile cards;
input car$ make$;
cards;
800 maruti
alto maruti
santro hyudai
;
proc print;

data details;
infile cards;
input car$ color$;
cards;
800 red
alto black
santro silver
;
proc print;
run;
/* Illustrate the creation of the hash table, the processing of */
/* the Master data set, and the searching of the hash table */

/*creating hash table*/

data results;
length car color $8;


/* Build the hash table */

If _N_ = 1 Then

Do;
Declare Hash MyLkup(HashExp:8,Dataset:'details');
MyLkup.DefineKey('Car');
MyLkup.DefineData('color');
MyLkup.DefineDone();
Call Missing(Car, color);
End;

/* Read an observation from the Master (transaction) file */
set master;

/* Using the value of Code from the current Master file observation, */
/* search the hash table defined above */
Rc = MyLkup.Find(Key:car);
/* Upon a successful search, write an observation to the output data set */
If Rc = 0 Then
Do;
Output Results;
End;
Run;

Thursday, August 6, 2009

processing of data step

@ vs @@ (line hold specifiers)

when the end of input statement is reached the pointer moves to t he next line .also the input buffer is replaced with new line of data that follows.SAS executes the following statements using the values in the pdv(program data vector).
There are situations when reading rest of data in a line depends on data read so far.in other words if there is a need to execute a second input statement to read rest of data from input buffer.
The trailing @ forces sas to hold the pointer on the current position of data in the input buffer .also causes sas to execute another input statement before the contents of input buffer are replaced .
Let us see the following example---

data data1;
infile cards;
input city :$ @;
do quarter =1 to 4 ;
input rain @;
output;
end;
cards;
delhi 50 45 55 67

;


run;

output---
` Obs city quarter rain

1 delhi 1 50
2 delhi 2 45
3 delhi 3 55
4 delhi 4 67

The first use of @ holds the dataline to read further values from the dataline using a second input statement.the second @ hold the dataline to read further values of ‘rain’ form same dataline .
Noteall this is done in a single data step;

@@
The trailing @@ causes the input statement to be executed repeatedly for the same dataline and each time the input statement is executed an iteration of data step also takes place.
One situation is when we want to read multiple records from same line of data.

Data multiple;
Infile cards;
Input name$ city$ @@;
Cards;
Smith nj Scott ca tiger del
;
Run;

Output—

Obs name city

1 Smith nj
2 Scott ca
3 tiger del

Two values at a time are read using data from input buffer.sas reaches the end of data step.pointer is hold at the same dataline even after the dat step is executed and the values are still there in the input buffer.
Here @ would not work because the next iteration of data step would have set the values to missing.
So the difference between @ @@ is that while trailing @ hold the line for the same iteration of the data step,trailing @@ hold the dataline even for the next iteration as well.

Friday, July 31, 2009

IIPH HYDERABAD ::FIRST BATCH IN BIOSTATISTICS AND DATA MANAGEMENT GRADUATED

SOURCE--PRESS
Hyderabad|India|July'2009:Indian Institute of Public Health - Hyderabad (IIPH), the first institute established by the Public Health Foundation of India, organized their Diploma Awards Ceremony for the students of the first batch of Post Graduate Diploma in Biostatistics & Data Management. Mr. L.V Subrahmanyam, IAS, Principal Secretary to Government Health, Medical & Family Welfare Department, and Government of Andhra Pradesh was the Chief Guest for the ceremony. Prof. K Srinath Reddy, President, Public Health Foundation of India presented the key note at the occasion. All the 27 students of the batch were honored Diploma awards by Mr. L.V Subrahmanyam.

A year long Post Graduate Diploma in Biostatistics and Data Management was launched in August, 2008 at IIPH - Hyderabad . This course was designed to equip students with modern tools of data management and applied biostatistics, in order to qualitatively enhance the skills of practicing biostatisticians and epidemiologists in the areas of medical research and public health. The target audience for this course includes public and private sector organizations, academicians and researchers in public health, medical colleges, hospitals, contract and clinical research organizations and pharmaceutical agencies, those engaged in national public health programmes initiated by the Government of India and research institutions.

Commenting on the occasion, Mr. L.V Subrahmanyam, “The State government has decided to make master’s degree in public health compulsory for its medical officers aspiring to become Additional District Medical and Health Officers, District Medical and Health Officers and Directors of Health from 2011-12. The government will enable such officers to undergo the master’s course in public health from the Indian Institute of Public Health (IIPH) here at its expense and then absorb them in the posts, Principal Secretary, Medical and Health”

K. Srinath Reddy, president, Public Health Foundation of India which had set up IIPH said the foundation was waiting for a master’s programme to take off at its institutes at Hyderabad , New Delhi and Gandhinagar.

The Public Health Foundation of India (PHFI) is a public private partnership that has collaboratively evolved through consultations with multiple constituencies including Indian and international academia, state and central governments, multi & bi-lateral agencies and civil society groups. It is a response to redress the limited institutional capacity in India for strengthening training, research and policy development in the area of Public Health.

The Indian Institute of Public Health (IIPH) at Hyderabad is established by PHFI under a public-private partnership with Government of Andhra Pradesh. Spread over 45 acres of land, the Institute is a fully residential campus is upcoming for students and faculty. Apart from strengthening the health services of Andhra Pradesh, the IIPH is aimed to build capacity in public health policy development, programme design, delivery and evaluation as well as develop health system management. National programs like National Rural Health Mission (NRHM) as well as state and regional level health initiatives would also be assisted by the IIPH.

Send link to --

TopBlogDir.blogspot.com button Education Blog Directory Academic,  Learning & Educational Blogs - Blog Catalog Blog Directory SEO Court Directory myblog Visit blogadda.com to discover Indian blogs Add to Technorati Favorites Subscribe with Bloglines DigNow.net

Join My Community at MyBloglog!

Free Web Directory - Add Your Link
The Little Web Directory
Monster Directory A List Sites