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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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