Page 1 of 1

take out spaces and join fields into a file

PostPosted: Fri Feb 18, 2011 1:27 pm
by javivi
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.-¡

Re: take out spaces and join fields into a file

PostPosted: Fri Feb 18, 2011 9:39 pm
by javivi
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)

Re: take out spaces and join fields into a file

PostPosted: Fri Feb 18, 2011 11:18 pm
by Frank Yaeger
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' '))   

Re: take out spaces and join fields into a file

PostPosted: Mon Feb 21, 2011 8:38 pm
by javivi
Really,
thanks Frank.