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

Query to remove "comma" in a sort parm.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Yugaswaroopini

New User


Joined: 21 Dec 2007
Posts: 10
Location: India

PostPosted: Fri Dec 19, 2008 12:27 pm
Reply with quote

Hi All,

My input file has a name field which includes first name, middle name and last name which are separated by "commas(,)".. Please find below for details.
Input file:
**************************
PARIS, AND LILLIAN, et al
MS, AND CARRIE,
SIVAKS, ,
**************************

If there is no middle name and last name, my output file populates the name field as follows.

**************************
CLIENT NAME: SIVAKS, ,
**************************

My question - is there a way to suppress the "comma" in the ouput file??
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: Fri Dec 19, 2008 12:34 pm
Reply with quote

Hello,

Sure. Before you can implement somethng to supress some/all of the commas, the rules must be understood.

You need to set down which commas are to be deleted and which ones are to be retained. Once all of the rules are understood, code can be developed.

As you build "code" for your reuirement, people here will be able to help when there are questions.
Back to top
View user's profile Send private message
Yugaswaroopini

New User


Joined: 21 Dec 2007
Posts: 10
Location: India

PostPosted: Fri Dec 19, 2008 1:37 pm
Reply with quote

Hi,

My expected result should be as follows:

**************************
CLIENT NAME:PARIS, AND LILLIAN, et al
CLIENT NAME:MS, AND CARRIE
CLIENT NAME:SIVAKS
**************************
As per the program logic, a comma is inserted after the first name and before the third name.

->If second name and third name are spaces, there are two commas inserted in the output which needs to be removed in the succeeding sort program.
-> If the third name is spaces, the is a comma inserted after the second name which must be removed in the succeeding sort program.

Note: The name field is of length 150 which includes the first name, second name and last name.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Dec 19, 2008 2:51 pm
Reply with quote

Yugaswaroopini,

I think you can handle this in your program itself rather than doing another pass in SORT to remove the commas. Check the middle names/last names for spaces and process accordingly.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts RC query -Time column CA Products 3
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
Search our Forums:

Back to Top