Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
anatol

Active User

Joined: 20 May 2010
Posts: 121
Location: canada

 Posted: Thu Mar 15, 2018 3:43 pm    Post subject: Replace last name by first name 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.

sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 810
Location: Maryland

 Posted: Thu Mar 15, 2018 7:43 pm    Post subject: Try to do something YOURSELF, then ask here for any advice. This forum is not supposed to MAKE YOUR JOB instead of you.
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 810
Location: Maryland

Posted: Thu Mar 15, 2018 7:52 pm    Post subject: Re: Replace last name by first name

 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.
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10696
Location: italy

 Posted: Thu Mar 15, 2018 9:48 pm    Post subject: Reply to: Replace last name by first name 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
anatol

Active User

Joined: 20 May 2010
Posts: 121
Location: canada

 Posted: Thu Mar 15, 2018 9:59 pm    Post subject: Reply to: Replace last name by first name Thank you all.
Rohit Umarjikar

Senior Member

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

 Posted: Thu Mar 15, 2018 11:38 pm    Post subject: 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?
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10696
Location: italy

Posted: Fri Mar 16, 2018 1:39 am    Post subject: Reply to: Replace last name by first name

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
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 810
Location: Maryland

Posted: Fri Mar 16, 2018 2:13 am    Post subject: Re: Reply to: Replace last name by first name

 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.
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10696
Location: italy

 Posted: Fri Mar 16, 2018 2:40 am    Post subject: Reply to: Replace last name by first name parse on what ?
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 810
Location: Maryland

Posted: Fri Mar 16, 2018 9:30 pm    Post subject: Re: Reply to: Replace last name by first name

 enrico-sorichetti wrote: parse on what ?

in field positions 40 - 200, using INREC for one of joined files before joining them
anatol

Active User

Joined: 20 May 2010
Posts: 121
Location: canada

 Posted: Fri Mar 16, 2018 10:58 pm    Post subject: Reply to: Replace last name by first name 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics IEBCOPY - Not replace a existing PDS ... Aks1988 JCL & VSAM 15 Mon Mar 09, 2020 7:06 pm How to copy\replace the members in pr... abdulrafi JCL & VSAM 6 Fri Mar 22, 2019 7:02 pm Add week number to a file name or rep... tejdeep0274 JCL & VSAM 2 Thu Jan 03, 2019 6:49 am Silly question maybe - REPLACE member... Cloink TSO/ISPF 15 Thu Oct 25, 2018 6:38 pm Replace comp-3 field value to comp-3 ... dharmaraok DFSORT/ICETOOL 5 Fri Sep 14, 2018 3:46 pm

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us