IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using ALTSEQ (multiple translations) only on certain fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
spainj125

New User


Joined: 25 Jan 2007
Posts: 7
Location: Atlanta, GA

PostPosted: Wed Feb 25, 2009 1:40 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 25, 2009 1:48 am
Reply with quote

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
View user's profile Send private message
spainj125

New User


Joined: 25 Jan 2007
Posts: 7
Location: Atlanta, GA

PostPosted: Wed Feb 25, 2009 1:51 am
Reply with quote

Thanks for your help....Will do....
Back to top
View user's profile Send private message
spainj125

New User


Joined: 25 Jan 2007
Posts: 7
Location: Atlanta, GA

PostPosted: Wed Feb 25, 2009 4:09 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 25, 2009 4:20 am
Reply with quote

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
View user's profile Send private message
spainj125

New User


Joined: 25 Jan 2007
Posts: 7
Location: Atlanta, GA

PostPosted: Wed Feb 25, 2009 4:22 am
Reply with quote

Cool...Yep thanks...was looking for a specific example for syntax but hard to find on the net
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 25, 2009 4:29 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Feb 25, 2009 4:32 am
Reply with quote

Quote:
was looking for a specific example for syntax but hard to find on the net


All of the DFSORT books are available online at:

Use [URL] BBCode for External Links

The books include lots of examples. Here are examples for the ALTSEQ statement:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/3.4.1?DT=20080528171007

Several of these examples use multiple code pairs.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top