BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ericykc
Fluorite | Level 6

A1234567BC012,A
15/FEB/1980,Y,Male,Married,3,FT,55000
3/JUN/1982,N,Female,Married,3,UE,0
24/JAN/2005,N,Male,Unknown,2,NA,0
D135EG023456789,B
19/OCT/1950,Y,Female,Divorced,0,PT,5000
X123A567F9,A
B2345234CC,A
21/MAY/1975,N,Male,Married,2,FT,30000
30/JUN/1978,Y,Female,Married,1,PT,10000

 

It consists of a header record for a household and is immediately followed by one record (row) for each household member, if applicable. For example, a household of three members will have three records exactly after its header record. How can i read the header only

1 ACCEPTED SOLUTION
3 REPLIES 3
ericykc
Fluorite | Level 6

thanks for helping me on pervious question. May I ask that how to let the programme know how many record under the Header? Thank a lot!

mkeintz
PROC Star

@ericykc wrote:

thanks for helping me on pervious question. May I ask that how to let the programme know how many record under the Header? Thank a lot!


You should probably start a new thread:  "how to read a hierarchical file, with household ID and number of household members".

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 519 views
  • 1 like
  • 3 in conversation