BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all!
I need to format the input data
Thanks!
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
Looks like you also need to add punctuation $$, etc to the number for EVT 1 too?? Is this data and report or data manipulation related to your previous posts showing similar data???

cynthia
deleted_user
Not applicable
Yes I need to add the $ sign for all amounts as well as inset commas and ampersands for names.
This is basically the previous part of teh code which is formatting of the data.
Thsi formatted data will be input to my other transwrd code.

Thanks!
Cynthia_sas
SAS Super FREQ
Does CUST=100 with EVT=23 have any relationship at all to CUST=123 with EVT=1??? I ask because with BY group processing, all the CUST=100 would sort before CUST=123. I sense that these 4 observations may be related to one "case"...what would happen if you had 2 "cases" How do you know that the EVT=1 belongs to the observations "above" it???

cynthia
deleted_user
Not applicable
They are not related to Cust=123 in this example. But yes there can be a dollar amount as well as the customer name for Cust=100 or for that matter any customer.
data_null__
Jade | Level 19
This works for PARTY given you data but you need to show more records, and complete specs.

[pre]
ata test;
input (Cust Typ ID Field)($) field_value &$16.;
cards;
100 EVT 23 PARTY JOHN SMITH
100 EVT 23 PARTY EMMA SMITH
100 EVT 23 PARTY BBT COMPANY
123 EVT 1 AggValue 61309
;;;;
run;
proc print;
run;

data test2;
do until(last.field);
set test;
by cust typ id field;
if field eq 'PARTY' then do;
length string $64;
string = catx(cat(substr(', &',1+last.field,1+last.field),' '),string,field_value);
end;
else string = ' ';
end;
run;
proc print;
run;
[/pre]
Cynthia_sas
SAS Super FREQ
Hi:
There have been a lot of previous postings about the John Smith and the EVT data -- rather than posting pieces of the same problem program over and over, perhaps you could share one entire program log and a sample of your data for folks to work with.

cynthia
These previous posts all seem to be related:
http://support.sas.com/forums/message.jspa?messageID=40884#40884
http://support.sas.com/forums/thread.jspa?messageID=39405駭
http://support.sas.com/forums/thread.jspa?messageID=39561骉
http://support.sas.com/forums/thread.jspa?messageID=39972鰤
http://support.sas.com/forums/thread.jspa?messageID=40211鴓

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 6 replies
  • 802 views
  • 0 likes
  • 3 in conversation