Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sas coding

Status
Not open for further replies.

samsas

Technical User
Joined
Sep 4, 2012
Messages
2
Location
US
Hi

I need the coding for the following;

/*task*/

data r;
input info $ 1 - 50;
cards;
101 pencils 42
102 parker pens 21
103 apple ipod touch n shuffle 09
104 dell studio laptop 02
run;

I need to find the coding for the above.
want the colums to be named prid priname and prqty.

prid and prqty ( should be numerical when u check the data file)
priname should be (character)
I can get the code if i manipulate the data.

data o;
input prid info $4-30 pqrty;
cards;
101 pencils 42
102 parker pens 21
103 apple ipod touch n shuffle 09
104 dell studio laptop 02
run;

can u help get the code
 
Some one please help
 
Hi,

It seems there no direct solution to this problem as your priname variable is of variable length.
I suggest you to go back to the source program which generates your data file.

If it is getting generated out of some DBMS, its easy to insert a proper delimiting character between two variables
like ',' or '|' and then you can eaisly get the sas code done.

All the best.

sasbuddy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top