Hello folks. i have some data which needs to be split into 12 or so different groups, there is no key and the order the data is in is important. the data has a number of groups and those groups have singular and / or nested groups within that. each group will be split out as the data is (again like some previous posts) in a hierarchical format. so each "GROUP" then has its own format which then all needs to be joined up on one line. the difference is to the other issues i've faced is this has many nested groups.. the best way i can write out the hierarchy groupings is 1. Transaction [TRANS] 1.1. Meter Point [MTPNT] 1.1.1. Asset [ASSET] 1.1.1.1. Meter [METER] 1.1.1.2. Converter [CONVE] 1.1.1.3. Register Details [REGST] 1.1.1.3.1. Reading [READG] 1.1.1.4. Market Participant [MKPRT] 1.1.1.5. Name [NAME] 1.1.1.5.1. Address [ADDRS] 1.1.1.5.2. Contact Mechanism [CONTM] 1.2. Appointment [APPNT] 1.3. Name [NAME] 1.3.1. Address [ADDRS] 1.3.2. Contact Mechanism [CONTM] 1.4. Market Participant [MKPRT] a previous method i have used before was retain and by groups, but that was only for one nested group and i feel i'm getting lost when trying it over so many groups, as once they are split (this is needed for labeling the variables per split) i need a key to join the sub groups back to the parent then, join that back to the main group. cavaet: there are 40k extracts with 10k rows each, and not all of the files have all the groups and subgroups each file. data sample: "TRANS","JOB1000287648","","","EXCHG","","","","COMLT","","D",,"OAMI","501928",,
"MTPNT","",2143024201,"","","","","",1.022640,,
"ASSET","","REMVE","METER","","PP","METLG210","LPG",2014,"L9999999999M","01","","RE"
"METER","","U","ET",6.0000,"","",,"",,
"REGST","","METER",5,"SCMH",1.000
"READG",20160213,,"50384"
"ASSET","","INSTL","METER","","PP","METLG210","LPG",2014,"L23453466756X","01","","LI"
"METER","","U","ET",6.0000,"","",,"",,
"REGST","","METER",5,"SCMH",1.000
"READG",20160213,,"00566"
"APPNT","",20160213,,"","080000","" I'm trying to achieve to get a primary key for each group and sub group and sub sub group for when i join it back to TRANS. I need help in the thought process of how to get these key, my initial thoughts a first. by group processing, but with so many nested groups, i need it to be unique to join back together as the sample above would be 2 rows 2 ASSET subgroups under 1 TRANS parent grouping. anyone who has dealt with energy and flow data before would run a mile, hahaha! Thanks Everyone for reading, Matt SAS 9.4M2 Grid Server on REHL
... View more