Hi, I'm looking for a way to parsing a query string and storing values during data step. For example... I have a query sting (from a logfile) in SAS table (tablename = someLogfile , column name = queryString😞 &qp_ab=value1&qp_bc=value2&qp_ac=value3...&qp_i=valuei I would to create a new table with a column for qp1, a column for qp2, qp3,...and a column for qpi . the challenge that i'm having is that each queryString in the table someLogfile can be different. for example the next query string read could be &qp_ab=value1&qp_ac=value3...&qp_x=valuex So i don't know the number of query parameters, and the set of query parameters used can be different. I'm thinking that I'll need to use an array and some macro but wondering if anyone has an easy way to do this and can give me some better ideas. Thanks! John data data_logfile; set someLogfile; queryString_2=translate(queryString,'&','?'); count = countc(queryString_2,'&'); /*PARSE QUERY STING INTO AN ARRAY*/ /*WALK THROUGH THE QUERY STRING AND ASSIGN THE VALUE OF THE QUERY PARAMETER TO THE APPROPRIATE TABLE VARIABLE*/ do while i<count; i+1; end; run;
... View more