take out spaces and join fields into a file



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

take out spaces and join fields into a file

Postby javivi » Fri Feb 18, 2011 1:27 pm

Hi
I have the next file with 40 lrecL and 5 fields:
field-1 char(5)
field2 char(10)
field3 char(10)
field4 char(10)
field5 char(5)

aaaaaJUAN LOPEZ RAMIREZ 11111
bbbbbANA DELA VARELA 22222
cccccANTON REY OLMO 33333

and I need to generate the file
filed1 char(5)
field2 char(30)
field3 char(5)

aaaaaJUAN LOPEZ RAMIREZ 11111
bbbbbANA DELA VARELA 22222
cccccANTON REY OLMO 333333

It is possible?

Thanks.-¡
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: take out spaces and join fields into a file

Postby javivi » Fri Feb 18, 2011 9:39 pm

Easier than I thought, I found the solution myself:

  OPTION COPY                                         
  OUTFIL BUILD=(01,05,
      06,30,SQZ=(SHIFT=LEFT,MID=C' ',length=30),
      36,05)
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: take out spaces and join fields into a file

Postby Frank Yaeger » Fri Feb 18, 2011 11:18 pm

Good for you, but your solution is more complicated than it needs to be. Here's a simpler set of DFSORT control statements:

  OPTION COPY                                       
  INREC OVERLAY=(6:6,30,SQZ=(SHIFT=LEFT,MID=C' '))   
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: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: take out spaces and join fields into a file

Postby javivi » Mon Feb 21, 2011 8:38 pm

Really,
thanks Frank.
javivi
 
Posts: 47
Joined: Fri Jan 21, 2011 2:53 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post