/* ASATOASC REXX Converts the input stream from ASA carriage control to ASCII Carriage control. The first record received will just do carriage return x'0d' if it is a '1' in col one, after that it will do a x'0c' form feed HINT: good idea to do an XLATE 2-* E2A on stuff before then run this */ arg args signal on novalue signal on error /* initialize carriage control vars and */ /* ascii carriage control */ ff = '0c'x /* form feed */ cr = '0d'x /* carriage return */ nl = '0d0a'x /* new line */ /* asa carriage control */ cc = '+' asa.cc = cr /* carriage supress, no line feed */ cc = ' ' asa.cc = nl /* single space */ cc = '0' asa.cc = copies(nl,2) /* double space */ cc = '-' asa.cc = copies(nl,3) /* triple space */ cc = '1' asa.cc = cr /* new page first one */ extra = cr/* if ff is data then throw in cr */ do k = 1 'readto in' /* if we get one then output args string before input record */ if k <> 1 then do cc = '1' asa.cc = ff||cr /* new page the rest of cc = 1 */ end parse var in 1 cc 2 data if data = ff then extrachar = extra else extrachar = '' /* output the ascii cc with the data */ 'output' asa.cc||strip(data,'T')||extrachar end novalue: error: if args = 'FF' then 'output' ff /* slap on a ff at end to eject page if told to */ exit