4 my @values = qw(0 2 9.5 27 271 999.95 2718 9999.995 27182 271828
5 2718281 2**39 2**333 2**-21 -2 -9.5 -27 -271 -999.95 -2718 -9999.995
6 -27182 -271828 -2718281 -2**39 -2**333 -2**-21 -0 3.125 31.25 314.125
7 3141.5 31415.875 314159.25 3141592.625 31415926.5 271828182.25
8 3214567890.5 31415926535.875 -3.125 -31.375 -314.125 -3141.5
9 -31415.875 -314159.25 -3141592.625 -31415926.5 -271828182.25
10 -3214567890.5 -31415926535.875);
12 print "SET CCA=',,,'.\n";
13 print "SET CCB='-,[[[,]]],-'.\n";
14 print "SET CCC='((,[,],))'.\n";
15 print "SET CCD=',XXX,,-'.\n";
16 print "SET CCE=',,YYY,-'.\n";
17 print "INPUT PROGRAM.\n";
18 print "STRING EXPR(A16).\n";
19 print map ("COMPUTE NUM=$_.\nCOMPUTE EXPR='$_'.\nEND CASE.\n", @values);
21 print "END INPUT PROGRAM.\n";
23 print "PRINT OUTFILE='output.txt'/EXPR.\n";
24 for my $format qw (F COMMA DOT DOLLAR PCT E CCA CCB CCC CCD CCE N Z) {
29 $min_w++ if $format eq 'DOLLAR' || $format eq 'PCT';
30 $min_w = 2 if $min_w == 1 && ($format =~ /^CC/);
34 for my $w ($min_w...40) {
35 my ($f) = "$format$w.$d";
36 print "PRINT OUTFILE='output.txt'/'$f: \"' NUM($f) '\"'.\n";
39 print "PRINT SPACE OUTFILE='output.txt'.\n";