0

I am trying to write a zero padded field in a test file that a COBOL program will read using the picture clause 9(5)v999. However I am unable to find the proper format. I've tried z8.3 but SAS inserts the decimal point...ie 99.999 where as I need 00099999 as the result. Any help would be appreciated.

2

1 Answer 1

1

I believe this is what you are after:

proc format ;
  picture x low-high = '99999999' (prefix='0' mult=100);
run;

data _null_;
  do cnt = 0 to 20 by 0.5;
    put cnt x.;
  end;
run;

You can find some more examples of custom formats in this PDF:

www2.sas.com/proceedings/sugi29/236-29.pdf

Cheers Rob

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.