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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAS and concatenated mixed data.

Status
Not open for further replies.

SPhill

Programmer
Sep 17, 2003
32
0
0
GB
I’ve got a problem, we’ve got a large number of datasets
with different variables in different places which have
been concatenated into one large dataset, what I need to
do is read it all into a datastep and do a proc
summary/tabulate etc. Normally I’d use something like this
for reading in csv files:

DATA A1;
INFILE inf DLM = ',' DSD MISSOVER FIRSTOBS =2 ;
LENGTH prdref £8. sex1 £1. distchan £1. premtype £2. i_prmst £2. agid £7. smkr£1.;
INFORMAT currdta DDMMYY8. dob1a DDMMYY8. ;
INPUT obs1
polref
inrref
covref
prdref
prdvr_no
schno
currdta
dob1a
etc etc …………………

but I can’t as the variables are mixed up in the
concatenated dataset. I’d rather not individually set up
an import procedure for every change of u****** as
there’s loads plus the record length is 4000 so there are
lots of vars as well.

Any suggestions great fully received.


Using JCL & mainframe SAS v8.2.

Example of data:-

U226SU !,SPCODE,POL_NUMBER,AGE_AT_ENTRY,ANNUAL_PREM,SEX,
U226SU *,1,45000040,19,0.00,0,228,1988,0.00,1,1,0.00,0.0
U226SU *,1,45017899,31,0.00,0,225,1988,0.00,1,1,0.00,0.0
U226SU *,1,45034116,24,0.00,0,223,1988,0.00,1,1,0.00,0.0
U226SU *,1,45049865,25,0.00,1,223,1988,0.00,1,1,0.00,0.0
U226SU *,1,45068425,36,0.00,0,223,1988,0.00,1,1,0.00,0.0
U226SU *,1,45073872,54,0.00,0,114,1997,0.00,1,1,0.00,0.0
U226SW !,SPCODE,SALES_CHAN,TERR,AGE_AT_ENTRY,SEX,POL_TER
U226SW *,1,1,1,39,0,21,4,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,55,0,20,3,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,19,0,40,7,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,31,0,29,1,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,28,0,32,6,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,43,1,22,5,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,37,0,23,1,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,41,0,24,3,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,30,0,30,1,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,25,1,35,5,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,34,0,26,2,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,24,1,35,9,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,36,0,24,0,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,29,1,31,6,0.00,1,0.00,0,0,0,0,0,0,0,95.00
U226SW *,1,1,1,36,0,24,2,0.00,1,0.00,0,0,0,0,0,0,0,95.00
 
Sorry, I think you're going to have to bite the bullet and write a separate step for each dataset.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Yep, I've had to do this, we've got about 16 different formats all concatenated together so I've set up 16 different import procedures in a macro which works o/k, bit of a pain tho.

Anyway thanks for the reply.

SP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top