文字列の長さに合わせてブロックコメントを生成する

data _null_;
    comment_text = strip(&comment_contents.);
    comment_len = (length(comment_text) - klength(comment_text)) / 2 + klength(comment_text);
    comment_line = '/*-' || repeat('-', comment_len - 1) || '-*/';
    put comment_line;
    put '/* ' "&comment_contents." ' */';
    put comment_line;
run;

Revision #1
Created 23 September 2024 07:16:47 by nonoha
Updated 28 September 2024 05:51:20 by nonoha