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

Help needed in SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Nov 08, 2012 2:28 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Nov 08, 2012 2:28 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 08, 2012 3:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top