fork download
  1. /* Demonstrates expressions and assignments in PL/I */
  2. EXPR: PROCEDURE OPTIONS(MAIN);
  3. DECLARE A FIXED DECIMAL(5) INITIAL(10);
  4. DECLARE B FIXED DECIMAL(5) INITIAL(20);
  5. DECLARE RESULT FIXED DECIMAL(10);
  6. DECLARE STR1 CHARACTER(5) INITIAL('Hello');
  7. DECLARE STR2 CHARACTER(6) INITIAL(' World');
  8. DECLARE CONCAT CHARACTER(11) VARYING;
  9. DECLARE IS_GREATER BIT(1);
  10.  
  11. RESULT = A + B * 2;
  12. CONCAT = STR1 || STR2;
  13. IS_GREATER = B > A;
  14.  
  15. PUT SKIP LIST('Sum with multiplication:', RESULT);
  16. PUT SKIP LIST('Concatenated string:', CONCAT);
  17. PUT SKIP LIST('Is B greater than A?:', IS_GREATER);
  18. END EXPR;
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
Standard output is empty