PL/1中的冒泡排序(How to write Bubble Sort with PL/1)
SHELL: PROCEDURE OPTIONS (MAIN);
DECLARE
ARRAY(50) FIXED BIN(15),
(K,N) FIXED BIN(15);
GET LIST(N);
GET EDIT((ARRAY(K) DO K = 1 TO N));
PUT EDIT((ARRAY(K) DO K = 1 TO N));
CALL BUBBLE(ARRAY,N);
END BUBBLE;
BUBBLE: PROCEDURE(ARRAY,N); /* BUBBLE SORT*/
DECLARE (I,J) FIXED BIN(15);
DECLARE S BIT(1); /* SWITCH */
DECLARE Y FIXED BIN(15); /* TEMPO */
DO I = N-1 BY -1 TO 1;
S = ’1′B;
DO J = 1 TO I;
IF X(J)>X(J+1) THEN DO;
S = ’0′B;
Y = X(J);
X(J) = X(J+1);
X(J+1) = Y;
END;
END;
IF S THEN RETURN;
END;
RETURN;
END SRT;
PL/1中的Hello World(How to write Hello World with PL/1)
HELLO: PROCEDURE OPTIONS (MAIN);
/* A PROGRAM TO OUTPUT HELLO WORLD */
FLAG = 0;
LOOP: DO WHILE (FLAG = 0);
PUT SKIP DATA('HELLO WORLD!');
END LOOP;
END HELLO;
Notes in my PLI studying (ENDFILE)
This is some notes about a condition parameter ENDFILE.
As we know , ENDFILE is used for checking whether the read operation is reach the end of the input file,
for examp: Read more
PLI Overview
PL/I is a general-purpose programming language, which is used for solving problems in a variety of fields such as commerce, science (including mathematics, physics, chemistry), engineering (including civil, electrical, aeronautics), medicine and so on. It can be used for system programming, and the facilitites are such that it is rarely if ever necessary to resort to machine-language or assembly-language programming to solve problems.
PL/I has outstanding facilities for commercial and business use. It has more power than Pascal, Fortran 95, BASIC, C, and COBOL, and has comparable facilities to Ada. The main areas where PL/I is superior include interrupt handling, the built-in debugging aids, the macro processor facilities, string-handling, and input-output (see below).
The language has good documenting and self-documenting facilities; programs are easy to read and to understand. It bears some resemblance to Fortran and BASIC.
The language is suitable for beginners, as well as for anyone wanting to become a professional.


