Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1534
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: 10256
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us