06-02-2011 10:44 AM
06-02-2011 10:55 AM
06-02-2011 02:30 PM
03-20-2012 03:53 PM
I have a similar problem, so I was happy to find this post! However, mine is a little bit different since I want to extra rows to be blank except for the identifier column. For example, starting with Table HAVE:
I'm trying to get to Table WANT:
The second row in Table WANT is the "inserted row" with missing values in the Data Columns. Using your code and a column that indicates when and how many rows to insert, I can insert the wanted extra row but the value in Data Columns is X. Now I want to set X to missing, but only for the added row.
03-20-2012 04:31 PM
Since I have the ready-to-go sample set from polingjw , only a minor change to his/her code will do.here is what I came up with:
input no part $ qty;
1 A100 2
5 B100 3
25 A100 1
35 B100 2
data want(keep=no part qty);
retain qty 1;
do _n_=1 to oldqty;
03-20-2012 04:37 PM
On the code where you are adding the row follow with something like "VAR = .;" before the additional output.
I suspect you have a logical condition being and if you are useing an IF - THEN structure to create the additional row you may need to use a DO - END to get the assignment in right place. If you have a lot of variables an array could be used.
An example of your almost working code would provide a better start point.