IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Replace last name by first name


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

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Mar 15, 2018 3:43 pm
Reply with quote

Hello,
I have file with users Last name ( position 1-10) First name ( position 11-21)
and second file, where in field positions 40 - 200 may be user Last name in any of this field position. Could you please give me idea to create output file where Last name from second file changed to the user first name. Output file should have only records from second file that was changed.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Thu Mar 15, 2018 7:43 pm
Reply with quote

Try to do something YOURSELF, then ask here for any advice.

This forum is not supposed to MAKE YOUR JOB instead of you.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Thu Mar 15, 2018 7:52 pm
Reply with quote

anatol wrote:
Could you please give me idea to create output file where Last name from second file changed to the user first name.

The idea is, using the parameters PARSE=, and BUILD=
Another thing is - using SS to perform string comparison within varying positions.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Thu Mar 15, 2018 9:48 pm
Reply with quote

changing data in some dataset based on the content of another dataset
can be done easily enough with a JOINKEY operation

but JOINKEY needs the keys in a fixed position
since one of the keys is not in a FIXED position, the approach is impossible
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Thu Mar 15, 2018 9:59 pm
Reply with quote

Thank you all.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2508
Location: NY,USA

PostPosted: Thu Mar 15, 2018 11:38 pm
Reply with quote

You haven't told us clearly at first place as to what exactly is expected with sample data.
Do you need to match two DS and if last name from second ds= first name from first ds then write else skip?
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Fri Mar 16, 2018 1:39 am
Reply with quote

no need for any detailed description of the data

Quote:
... where in field positions 40 - 200 may be user Last name in any of this field position. ...



that' s the show stopper for a joinkey solution
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Fri Mar 16, 2018 2:13 am
Reply with quote

enrico-sorichetti wrote:
but JOINKEY needs the keys in a fixed position
since one of the keys is not in a FIXED position, the approach is impossible

Using PARSE=, and BUILD= before JOINKEYS may help with this approach, too.
Also other approaches are available.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10697
Location: italy

PostPosted: Fri Mar 16, 2018 2:40 am
Reply with quote

parse on what ?
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 879
Location: Maryland

PostPosted: Fri Mar 16, 2018 9:30 pm
Reply with quote

enrico-sorichetti wrote:
parse on what ?

in field positions 40 - 200, using INREC for one of joined files before joining them
Back to top
View user's profile Send private message
anatol

Active User


Joined: 20 May 2010
Posts: 121
Location: canada

PostPosted: Fri Mar 16, 2018 10:58 pm
Reply with quote

I've went other way ... from file1 ( Lastname Firstname) I've generated sort statements with FINDREP .... lastname to firstname name using
sqz, left, lead, trail,mid...
then for file2 I use those statements
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Need to split single line into two li... DFSORT/ICETOOL 7
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
No new posts IEBCOPY - Not replace a existing PDS ... JCL & VSAM 15
No new posts How to copy\replace the members in pr... JCL & VSAM 6
No new posts Add week number to a file name or rep... JCL & VSAM 2

Back to Top