3WAY gets you one range of a record. You'll need two, the second on the tertiary output from the first.
|w1: 3way w4 |g1: gather \w1: |reverse |g1: \w1: |w2: 3way w-2 |g1: \w2: |reverse |g1: \w2: |g1: j. 2009/8/25 Shimon Lebowitz <shimon...@gmail.com>: > I am trying to deal with a problem apparently created for me by Mr. Gates & > Co. > > I need to send files from CMS to end users on PCs, where the > files contain data which represents Hebrew characters. I gave > SMTP a translation table which converts the EBCDIC representation > of Hebrew to the ASCII used by Windows, but the PC is a smart alec, > and also reverses the character order, since Hebrew reads right to left. > > So, if I have input records like this on CMS: > > 2008 12987 65084 abcdefgh 78346 45239 tuvwxyz 873468 > 2009 31 836 ijklmno 169827 8373 mnop 34902 > > (Note: the letters in the actual record will be Hebrew! I only used > English to prevent the confusion that happens when the order gets > reversed. And besides, how many of you have Hebrew fonts?). > > If I SendFile a file of those records to a MS-Win system, > the characters will be displayed on the screen as hgfedcba, zyxwvut, > etc. In order to have the data normal when it arrives, I need > to reverse the field which contains the Hebrew text, but obviously NOT > the other parts of the record, which would destroy the numeric values. > > What I think would be my favorite solution would be for the REVERSE > stage to accept inputranges, as the XLATE stage does. That would be great! > A simple ... | REVERSE 22-31 48-56 | ... would solve my problem > easily and elegantly. But... REVERSE has no ranges. :-( > > Since the EXEC I am writing must deal with many different > files, and will receive external arguments defining the positions > of the Hebrew fields, I need a generalized solution. I tried something > with a particular case, where I knew the positions (only one > Hebrew field 5-24) and the record length (fixed 32): > ... > 'F1: FANOUT |', > 'F2: FANINANY |', > 'JOIN 1 |', > 'SPECS 1-32 1 33-* 5 |', > '>' OUTPUTID, > '? F1: |', > 'SPECS 5-24 1 |', > 'REVERSE |', > 'F2:' > > How would I generalize this? And is there a better way? > > Thanks! > Shimon >