SASUnit Examples  Version 1.2
_sasunit_getpgmdesc.sas
Go to the documentation of this file.
1 
21 /* History
22  02.10.2008 NA modified for LINUX
23 */
24 
25 %MACRO _sasunit_getPgmDesc (
26  i_pgmfile =
27  ,r_desc = desc
28 );
29 
30 %LET &r_desc=;
31 %IF NOT %sysfunc(fileexist(&i_pgmfile)) %THEN %RETURN;
32 
33 data _null_;
34  infile "&i_pgmfile" truncover end=eof;
35  length desc $255;
36  retain inbrief 0 desc;
37  input line $255.;
38  if upcase(line) =: '\BRIEF' then do;
39  line = left (substr(line,7));
40  inbrief=1;
41  end;
42  if substr(line,1,1)='\' or line=' ' or line='0D'x then inbrief=0;
43  if inbrief then do;
44  if desc=' ' then desc = line;
45  else desc = trim(desc) !! ' ' !! line;
46  end;
47  if eof then call symput("&r_desc", trimn(desc));
48 run;
49 
50 %MEND _sasunit_getPgmDesc;