How to split strinf using DFSORT ?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to split strinf using DFSORT ?

Postby kamal » Wed Aug 22, 2007 5:27 pm

Hi I am creating a report using SORT.

Here I am stuck with one problem.
The name is FULL NAME in
FIRSTNAME$LASTNAME format
e.g.
FULL NAME is : JIMI$ADAMS
here First NAME is JIMI and LAST NAME is ADAMS.

I have to populate FIRSTNAME and LASTNAME seperately.

How can FULL name be splitted in Last name and first name?
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to split strinf using DFSORT ?

 

Re: How to split strinf using DFSORT ?

Postby Frank Yaeger » Wed Aug 22, 2007 9:20 pm

You can use DFSORT's PARSE function to do that. For example:

//S1    EXEC  PGM=ICEMAN                           
//SYSOUT    DD  SYSOUT=*                           
//SORTIN DD *                                       
JIMI$ADAMS                                         
FRANK$YAEGER                                       
MICKEY$MOUSE                                       
CHARLOTTE$SPIDER                                   
//SORTOUT DD SYSOUT=*                               
//SYSIN    DD    *                                 
  OPTION COPY                                       
  INREC PARSE=(%01=(ENDBEFR=C'$',FIXLEN=10),       
               %02=(ENDBEFR=C' ',FIXLEN=10)),       
  BUILD=(%01,X,%02)                                 


SORTOUT would have:

JIMI       ADAMS     
FRANK      YAEGER   
MICKEY     MOUSE     
CHARLOTTE  SPIDER   


For more information on DFSORT's PARSE function, see:

http://www.ibm.com/servers/storage/supp ... /mvs/peug/
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: How to split strinf using DFSORT ?

Postby kamal » Thu Aug 23, 2007 10:07 am

Yes,this will do..Thanks Frank !
kamal
 
Posts: 49
Joined: Wed Aug 22, 2007 2:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to split strinf using DFSORT ?

Postby Frank Yaeger » Thu Aug 23, 2007 9:02 pm

Glad I could help.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post