Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Help needed in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
amit_tater

New User


Joined: 22 Dec 2006
Posts: 9
Location: Indore

PostPosted: Thu Nov 08, 2012 2:04 pm    Post subject: Help needed in SORT
Reply with quote

I have a file with record as

001 LNAME1, FNAME1 FNAME2 P.O.BOX 00
002 LNAME2, FILEN P P.O.BOX 01

I want to separate the name fields in such a way that the First name, last name, middle name and middle initial should be populated in position 5, 25, 45 and 60th position of output file respectively. First name and last name are separated by ',' . last name and middle name are separated by a space. If middle name is of one character then it will be treated as middle initial otherwise it will be treated as middle name.

The output will look like

001 LNAME1 FNAME1 FNAME2 P.O.BOX52
002 LNAME2 FILEN P P.O.BOX86

INput File is a FB with record length as 200.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Thu Nov 08, 2012 2:28 pm    Post subject:
Reply with quote

Also you wanted to replace ',' by space and P.O.BOX 00 to P.O.BOX52 and
P.O.BOX 01 to P.O.BOX86?

Please clarify better
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Thu Nov 08, 2012 2:28 pm    Post subject: Reply to: Help needed in SORT
Reply with quote

if You had posted the data using the code tags, everything would have been more clear...

the code tags preserve the spacing

without ...
1234567890
>> <<

with
Code:
1234567890
>>      <<


as posted the information provided is completely useless
Back to top
View user's profile Send private message
amit_tater

New User


Joined: 22 Dec 2006
Posts: 9
Location: Indore

PostPosted: Thu Nov 08, 2012 3:04 pm    Post subject:
Reply with quote

for example

Code:
001 JAMES, KLEN CARTER   P.O.BOX 52
002 AARON,FILEN P        P.O.BOX 86


output expected
Code:
001   JAMES      KLEN      CARTER         P.O.BOX52
002   AARON      FILEN                P   P.O.BOX86
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Nov 08, 2012 3:29 pm    Post subject: Reply to: Help needed in SORT
Reply with quote

How is this so similar to this one?

Anyway, for the data in variable positions, you use PARSE.

If you want to know of a single initial, test for space after the first byte.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us