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
 

 

Sorting a Free Form File based on last name

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

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Tue Mar 20, 2007 7:44 pm    Post subject: Sorting a Free Form File based on last name
Reply with quote

Hi All,

A Small problem I have is I need to Sort a free form file based on last name and the last name does not always start from the same position in that sequential File.

Please let me know if and how could I do it using DFSORT.

Thanks !!
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Mar 20, 2007 7:59 pm    Post subject:
Reply with quote

Let's say you are going to read this file by a COBOL program. How is this program going to tell where is the "last name" field?

O.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Mar 20, 2007 8:47 pm    Post subject:
Reply with quote

geek_mohit,

You need to show an example of the records in the input file and what you expect for output. Also, give the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
geek_mohit

New User


Joined: 19 May 2006
Posts: 23

PostPosted: Wed Mar 21, 2007 11:26 am    Post subject: Re: Sorting a Free Form File based on last name
Reply with quote

Hi Frank,

This might be the information you require

Recfm VB
Lrecl 133

And the file is something of the Following Sort:-



Toronto,Steve Garamond

Char Hill,Orlando

605 - Madox Street,Arthur Charner

The Woodlands,Charity Thomas

I need to Extract the last names as :-

Garamond
Hill
Charner
Thomas

Thanks !!
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Mar 21, 2007 4:14 pm    Post subject: Re: Sorting a Free Form File based on last name
Reply with quote

What are the 'rules' for determining exactly what a 'last name' is?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Mar 21, 2007 8:53 pm    Post subject:
Reply with quote

Quote:
What are the 'rules' for determining exactly what a 'last name' is?


Psychic powers? icon_rolleyes.gif

geek_mohit,

Seriously, I can't find a pattern in your example data that would reveal how to write logic to extract the last name. In records 1, 3 and 4, it's the last non-blank "word" in the record, but record 2 doesn't fit that pattern. You have to be able to describe the "rules" for finding the last name you want before anybody can help you write logic for finding it.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Mar 21, 2007 8:58 pm    Post subject:
Reply with quote

Hello,

From what has been posted, there do not seem to be any rules. It appears to be "free" text that may or may not contain the same collection of data fields. We're only seeing a small part of the data and what little has been posted is a coding nightmare.

What if the second entry was for a person with the first name of Orlando and the last name of "Char Hill"? What if there was a person named Madox Street? And on and on. . . .

For my $.02, i'd be interested in what created the file. Possibly that could be improved to create some kind of delimited format that accounted for all of the fields in a record - in the same order in each record.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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