Hi All,
@Reeza @KurtBremser @ChrisHemedinger @Patrick @LinusH @Tom
I am trying to read few sas programs and create a dataset from it and extract some metadata from it.
So basically i am trying to read the whole program step by step and add some flags like below.
We are trying to flag the step_no: which is the count for the complete step, whether its a proc or a proc sql or datastep.
data_Step_no- for each value present for the step_no, assign incremental count till the datastep end.
proc_Step_no- for each value present for the step_no, assign incremental count till the proc end(or basically a run;).
We are trying to do this using @@ and mutiple find statements, however couldn't make it working for the data_step_no and proc_step_no. Do you think there is any such way to accomplish this task. We are trying to automate our migration. we are using sas EG7.1 on unix and sas 9.2
code
rec_no
step_no
data_step_no
proc_step_no
data want;
1
1
1
.
infile tmp truncover end=done;
2
1
2
.
input @1 father $9. mother $10. address $40.;
3
1
3
.
input child $9. age ?? 3.0 @@;
4
1
4
.
run;
5
1
5
.
DATA COMMAS;
6
2
1
.
INFILE DATALINES DLM=',';
7
2
2
.
INPUT ID HEIGHT WEIGHT GENDER $ AGE;
8
2
3
.
DATALINES;
9
2
4
.
1,68,144,M,23
10
2
5
.
2,78,202,M,34
11
2
6
.
3,62,99,F,37
12
2
7
.
4,61,101,F,45
13
2
8
.
;
14
2
9
.
run;
15
2
10
.
PROC PRINT;
16
3
.
1
TITLE 'Example 2.1';
17
3
.
1
RUN;
18
3
.
1
DATA AMPERS;
18
4
1
.
INPUT NAME & $25. AGE GENDER : $1.;
18
4
2
.
DATALINES;
18
4
3
.
RASPUTIN 45 M
18
4
4
.
BETSY ROSS 62 F
18
4
5
.
ROBERT LOUIS STEVENSON 75 M
18
4
6
.
;
18
4
7
.
run;
18
4
1
.
PROC PRINT;
18
5
.
2
TITLE 'Example 4';
18
5
.
2
RUN;
18
5
.
2
/* this is comment*/
19
.
.
.
... View more