Suvi104 Have a look at the following code, it uses test data, the DATA Step is made to read this kind of data: data test; infile cards dlm=";" truncover; * * check for the "record type" and keep record *; input @1 recType $16. @ ; * * define the var for the header values, assume fixed number *; retain scenario year period view entity value pdr; array myHeader{*} $ 12 scenario year period view entity value pdr; * * do not need the blank lines *; if char(RecType, 1) = " " then do; delete; end; * * start of header values, we will read the fixed number of lines *; if recType =: "!Scenario" then do; do i = 1 to dim(myHeader); input @1 tempValue $32.; myHeader{i} = scan(tempValue, 2, "="); end; end; else do; * * read the "data" lines and write to the output data set *; input @1 v1 : $32. v2 : $32. v3 : $32. v4 : $32. v5 : $32. v6 : $32. v7 : 8. ; output; end; * * we do not need these variables *; * drop recType i tempValue; cards4; !Scenario=ACTUAL !Year=2013 !Period=Dec !View=YTD !Entity=29xxx !Value=USD Total !PDR=No GC14A03;[ICP Top];MGMT;EOP;AllCuxxx;GROSS;32.7802 GC14A03;[ICP Top];MGMT;EOP;CAxxx_TOT;GROSS;32.7802 !Scenario=scenario2 !Year=year2 !Period=period2 !View=view2 !Entity=entity2 !Value=vaue2 !PDR=pdr2 r1_GC14A03;[ICP Top];MGMT;EOP;AllCuxxx;GROSS;32.7802 r2_GC14A03;[ICP Top];MGMT;EOP;AllCuxxx;GROSS;32.7802 !Scenario=ACTUAL !Year=2013 !Period=Jan !View=YTD !Entity=2xx01 !Value=USD Total !PDR=No GC14A10;[ICP Top];MGMT;EOP;AllCuxxm3;GROSS;0 GC14A11;[ICP Top];MGMT;EOP;AllCuxxm3;GROSS;0 GC14A12;[ICP Top];MGMT;EOP;AllCuxxm3;GROSS;0 GC14A13;[ICP Top];MGMT;EOP;AllCuxxm3;GROSS;0 ;;;;
... View more