View previous topic :: View next topic
|
Author |
Message |
spainj125
New User
Joined: 25 Jan 2007 Posts: 7 Location: Atlanta, GA
|
|
|
|
Hi, I am wanting to use ALTSEQ on a file to translate some invalid characters that are being sent in only on the first name and last name fields. I do not want to ALTSEQ the whole file because the characters to appear in other places within the file but the request was to only to make those changes to the first and last name fields....Also I need to do multiple translations in order to check and translate different possible characters within these fields...But I DO want to produce the whole file in the OUTREC. Is this possible? How would I code this? Thank you.. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
spainj125,
use the following control cards
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(p1:p1,m1,TRAN=ALTSEQ,p2:p2,m2,TRAN=ALTSEQ)
ALTSEQ CODE=(....)
/*
/* p1 = position of your firstname field
/* m1 = length of your firstname field
/* p2 = position of your lastname field
/* m2 = length of your lastname field
|
|
|
Back to top |
|
|
spainj125
New User
Joined: 25 Jan 2007 Posts: 7 Location: Atlanta, GA
|
|
|
|
Thanks for your help....Will do.... |
|
Back to top |
|
|
spainj125
New User
Joined: 25 Jan 2007 Posts: 7 Location: Atlanta, GA
|
|
|
|
Ok, I did the above and it worked...But this only works for one character...I need to translate multiple characters within the same field...I have tried several different syntax and they all fail or just tranlate only the first character....Can I use multiple ALTSEQ's within one SORT? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes.
Code: |
ALTSEQ CODE=(0040,FF40) |
This would translate x'00' to a space and x'FF' to a space (x'40'). They just need to be defined in from/to pairs. |
|
Back to top |
|
|
spainj125
New User
Joined: 25 Jan 2007 Posts: 7 Location: Atlanta, GA
|
|
|
|
Cool...Yep thanks...was looking for a specific example for syntax but hard to find on the net |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ALTSEQ is rather limited. FINDREP and/or IFTHEN clauses with FINDREP can do a lot more.
You can find complete information on DFSORT's FINDREP function at:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|