/*******************************************************************/
/* */
/* DESCRIPTION */
/* Sorting from an input data set to an output data set */
/* */
/* Use the following statements: */
/* set dd:sortin=ex106.dat,type(crlf),lrecl(80) */
/* set dd:sortout=ex106.out,type(crlf),lrecl(80) */
/* */
/* */
/*******************************************************************/
ex106: proc options(main);
dcl Return_code fixed bin(31,0);
call plisrta (' SORT FIELDS=(7,74,CH,A) ',
' RECORD TYPE=F,LENGTH=(80) ',
0,
Return_code);
select (Return_code);
when(0) put skip edit
('Sort complete return_code 0') (a);
when(16) put skip edit
('Sort failed, return_code 16') (a);
other put skip edit (
'Invalid sort return_code = ', Return_code) (a,f(2));
end /* Select */;
/* Set pl/i return code to reflect success of sort */
call pliretc(Return_code);
end ex106;図 37 で使用される EX106.DAT の内容
003329HOOKER S.W. RIVERDALE, SATCHWELL LANE, BACONSFIELD 002886BOOKER R.R. ROTORUA, LINKEDGE LANE, TOBLEY 003077ROOKER & SON, LITTLETON NURSERIES, SHOLTSPAR 059334HOOK E.H. 109 ELMTREE ROAD, GANNET PARK, NORTHAMPTON 073872HOME TAVERN, WESTLEIGH 000931FOREST, IVER, BUCKS