Transforming Records Using OUTREC

The following mfsort command transforms records containing a field of format cyymmdd to the format yyymmdd.

Sort C'cyymmdd' 
     SORT FIELDS=(1,7,BI,A)        * sort C'cyymmdd' 
     use org ls record (f 40)
    * Transform C'cyymmdd' to C'yyyymmdd' 
     OUTFIL OUTREC=(1,1,CHANGE=(2, * change C'c' as follows:
                      C'0',C'19',  *   C'0' to C'19' 
                      C'1',C'20',  *   C'1' to C'20' 
                      C'2',C'21'), *   C'2' to C'21' 
                    2,6)           * copy C'yymmdd' 

     give sortout.dat