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

Sorting a Free Form File based on last name


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

PostPosted: Tue Mar 20, 2007 7:59 pm
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 Developer


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

PostPosted: Tue Mar 20, 2007 8:47 pm
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
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
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 Developer


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

PostPosted: Wed Mar 21, 2007 8:53 pm
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

Moderator Emeritus


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

PostPosted: Wed Mar 21, 2007 8:58 pm
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 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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top