How can use sas code to convert the following data:
V-1 | V-2 | P-L | P-H | Model | ListOrder | CScore | V-L | V-H | Fscore | RuleNo |
AL | BALDWIN | 0 | 999999999 | P | 1 | 0 | 100000 | 1000000 | 10 | 1 |
AL | ELMORE | 0 | 999999999 | V | 1 | 93 | 100000 | 1000000 | . | 2 |
to:
RuleNo | Seq | V-1 | V-2 | P-L | P-H | Price-AVM | Price-Fraud | Variables | ServiceCount | Model |
1 | 1 | AL | BALDWIN | 0 | 999999999 | 0 | 0 | 1 | P | |
1 | 2 | S-C | 0 | |||||||
1 | 3 | F-C | 0 | |||||||
1 | 4 | Fscore | 10 | |||||||
1 | 5 | VALUE RANGE | 100000-1000000 | |||||||
2 | 1 | AL | ELMORE | 0 | 999999999 | 0 | 0 | 1 | V | |
2 | 2 | S-C | 0 | |||||||
2 | 3 | F-C | 0 | |||||||
2 | 4 | CScore | 93 | |||||||
2 | 5 | VALUE RANGE | 100000-1000000 |
Your "want" layout is a report, not a data storage one.
Where does "Variables" and "ServiceCount" come from?
Once you got them into place, this looks like a proc print to me.
Service count will always be 1 for each rule. Variables is the new column of row variables introduced as required by the template.
I do no see an obvious source for Price-AVM, Price-Fraud or where a Model Value comes from for S-C or F-C.
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.
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.