Re: dfsort remove spaces

2020-10-09 Thread Anthony B.
The suggestion was mine alone, and not meant to imply that it came from
you. That was not my intent.
In the sketchy strategy I suggested, my past task involved some additional
data manipulations other than differentiating various input formats.
Philosophically I agree that multiple passes of data are not an optimal
approach, but in my past I've done ad hoc and one off tasks where
additional pass(es) supply simplicity to the effort.

On Fri, Oct 9, 2020 at 3:39 PM Sri h Kolusu  wrote:

> >> I've borrowed and taken advice from Sri K. and that's
> always proven to be the path of simplicity.
>
> Anthony,
>
> Honestly I would never suggest multiple passes of data.  So I am not sure
> when I suggested "n" outfil approach to handle pattern.
>
> Thanks,
> Kolusu
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Sri h Kolusu
>Can DFSORT regular expressions do something similar?

Gil,

DFSORT supports regular expression for selecting/filtering data but it does
not support editing of the data.

>I believe Massimo Biancucci  has already posted a simpler more general
solution.

Agreed. Massimo solution covers OP's case perfectly.  I believe OP wanted
to remove the leading zeros for the first  3 fields as he used M10 edit
mask to remove the leading zeros.

So taking into that into consideration we would use the following control
cards

//SYSINDD *
  SORT FIELDS=COPY

  INREC OVERLAY=(001:001,010,UFF,M10,LENGTH=10,
 012:012,025,UFF,M10,LENGTH=25,
 038:038,025,UFF,M10,LENGTH=25,
 001:001,2500,SQZ=(SHIFT=LEFT,MID=C' '))

  OUTREC FINDREP=(INOUT=(C' |',C'|'))
/*

Thanks,
Kolusu

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Sri h Kolusu
>> I've borrowed and taken advice from Sri K. and that's
always proven to be the path of simplicity.

Anthony,

Honestly I would never suggest multiple passes of data.  So I am not sure
when I suggested "n" outfil approach to handle pattern.

Thanks,
Kolusu

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Paul Gilmartin
On Fri, 9 Oct 2020 11:43:44 -0500, Ron Thomas wrote:

>Anthony - The file has data as below also
>
>000657|VHO TRIVENTO RESERVA |MALBEC 750ML
>007762|FJAO PTO CAMIL   |T1 1KG
>007762|FJAO PTO CAMIL   |T1 1KG
>...
>Hence , coding fixed length OUTREC will not solve the problem
>
Hmmm.  I see that DFSORT lately supports regular expressions.
In a POSIX shell, I'd use "sed 's/  */ /g'".  Can DFSORT regular
expressions do something similar?  (I tested the sed command
on Ron's example.)

(Or just use sed called by BPXWUNIX.)

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Paul Gilmartin
On Fri, 9 Oct 2020 13:24:47 -0500, Anthony B. wrote:

>Let's assume that 'n' patterns of input exist. Above we see two. Code 'n'
>number of OUTFIL statements, each with their own OUTREC constructs. Sorry I
>don't have an example to show but in the past I've seen many of what's
>being discussed. I've borrowed and taken advice from Sri K. and that's
>always proven to be the path of simplicity.
>
Eek!  Complexity for its own sake?

What if the OP wants the records merged back into a single data set,
preserving their original order (a likely condition)?

I believe Massimo Biancucci  has already posted a simpler more
general solution.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Anthony B.
Let's assume that 'n' patterns of input exist. Above we see two. Code 'n'
number of OUTFIL statements, each with their own OUTREC constructs. Sorry I
don't have an example to show but in the past I've seen many of what's
being discussed. I've borrowed and taken advice from Sri K. and that's
always proven to be the path of simplicity.

On Fri, Oct 9, 2020 at 1:21 PM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Fri, 9 Oct 2020 13:02:26 -0500, Anthony B. wrote:
>
> >So create a second OUTFIL.
> >
> I don't understand what you're suggesting.  Can you provide
> details?  I suspect that what Ron posted was not his entire input,
> but other numbers of blanks might exist in a larger data set.
>
> >On Fri, Oct 9, 2020 at 11:43 AM Ron Thomas wrote:
> >
> >> Anthony - The file has data as below also
> >>
> >> 000657|VHO TRIVENTO RESERVA |MALBEC 750ML
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >> 007762|FJAO PTO CAMIL   |T1 1KG
> >>
> >> Hence , coding fixed length OUTREC will not solve the problem
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Paul Gilmartin
On Fri, 9 Oct 2020 13:02:26 -0500, Anthony B. wrote:

>So create a second OUTFIL.
> 
I don't understand what you're suggesting.  Can you provide
details?  I suspect that what Ron posted was not his entire input,
but other numbers of blanks might exist in a larger data set.

>On Fri, Oct 9, 2020 at 11:43 AM Ron Thomas wrote:
>
>> Anthony - The file has data as below also
>>
>> 000657|VHO TRIVENTO RESERVA |MALBEC 750ML
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>> 007762|FJAO PTO CAMIL   |T1 1KG
>>
>> Hence , coding fixed length OUTREC will not solve the problem

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Anthony B.
So create a second OUTFIL.

On Fri, Oct 9, 2020 at 11:43 AM Ron Thomas  wrote:

> Anthony - The file has data as below also
>
> 000657|VHO TRIVENTO RESERVA |MALBEC 750ML
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
> 007762|FJAO PTO CAMIL   |T1 1KG
>
> Hence , coding fixed length OUTREC will not solve the problem
>
> Thanks
> Ron T
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Paul Gilmartin
On Thu, 8 Oct 2020 10:46:00 -0500, Ron Thomas wrote:
>
>I have a sample file as below and we would need to remove the spaces
>
>000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
>...
>i have coded as below
>SORT FIELDS=COPY
>INREC OVERLAY=(001:001,010,UFF,M10,LENGTH=10,
>   012:012,025,UFF,M10,LENGTH=25,
>   038:038,025,UFF,M10,LENGTH=25,
>   001:001,2500,SQZ=(SHIFT=LEFT))
>
>but the output i am getting is as below
>
>645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
>...
Where did the "DEL" come from?


On Fri, 9 Oct 2020 11:46:22 -0500, Ron Thomas wrote:

>paul- this was a typo error , what the output i got from my control card is 
>below
>
>645|CASILLERODELDIABLO|VHOCASILLERODIABLO|
>
I repeat my question, "Where did the 'DEL' come from?"  Is it somehow
possible that you posted a SORTOUT excerpt that did not correspond to
the SORTIN excerpt you posted?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Ron Thomas
paul- this was a typo error , what the output i got from my control card is 
below

645|CASILLERODELDIABLO|VHOCASILLERODIABLO|

Thanks
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-09 Thread Ron Thomas
Anthony - The file has data as below also

000657|VHO TRIVENTO RESERVA |MALBEC 750ML
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG
007762|FJAO PTO CAMIL   |T1 1KG

Hence , coding fixed length OUTREC will not solve the problem

Thanks
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-08 Thread Anthony B.
I don't understand why the solution is so complex. If the spaces all line
up in fixed columns (I hope this assumption is correct), then simply coding
OUTRECs for each field non-blank would accomplish the desired output. I've
coded many hundreds of DF/SORT jobs and I don't see a degree of difficulty.
If I'm missing something obvious, I'll appreciate clarification.

On Thu, Oct 8, 2020 at 11:34 AM Paul Gilmartin <
000433f07816-dmarc-requ...@listserv.ua.edu> wrote:

> On Thu, 8 Oct 2020 10:46:00 -0500, Ron Thomas wrote:
> >
> >I have a sample file as below and we would need to remove the spaces
> >
> >000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> >...
> >i have coded as below
> >SORT FIELDS=COPY
> >INREC OVERLAY=(001:001,010,UFF,M10,LENGTH=10,
> >   012:012,025,UFF,M10,LENGTH=25,
> >   038:038,025,UFF,M10,LENGTH=25,
> >   001:001,2500,SQZ=(SHIFT=LEFT))
> >
> >but the output i am getting is as below
> >
> >645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> >...
> Where did the "DEL" come from?
>
> -- gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-08 Thread Ron Thomas
thanks a lot Massimo . it worked great !!

Regards
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-08 Thread Paul Gilmartin
On Thu, 8 Oct 2020 10:46:00 -0500, Ron Thomas wrote:
>
>I have a sample file as below and we would need to remove the spaces
>
>000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
>...
>i have coded as below
>SORT FIELDS=COPY
>INREC OVERLAY=(001:001,010,UFF,M10,LENGTH=10,
>   012:012,025,UFF,M10,LENGTH=25,
>   038:038,025,UFF,M10,LENGTH=25,
>   001:001,2500,SQZ=(SHIFT=LEFT))
>
>but the output i am getting is as below
>
>645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
>...
Where did the "DEL" come from?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: dfsort remove spaces

2020-10-08 Thread Massimo Biancucci
Ron,

sorry for me not understanding the meaning of the actual SYSIN.

If you run this (assuming SORTIN LRECL is 2500):
 INREC FIELDS=(1,2500,SQZ=(SHIFT=LEFT,MID=C' '))
 SORT FIELDS=COPY
 OUTREC FINDREP=(INOUT=(C' |',C'|'))

The INREC squeezes the record dropping all spaces and inserting a single
space where before was 1 or more spaces (so 2 or more spaces becomes 1
space).
MID is the magic keyword.
This will build a rec like this:
000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML |

The OUTREC FINDREP replace all " |" with "|" and then:
000645|VHO CASILLERO DIABLO|PINOT NOIR 750ML|

I think you INREC PARSE could have been a good solution too (it seems "|"
it's the fields separator).

Best regards.


Il giorno gio 8 ott 2020 alle ore 17:46 Ron Thomas  ha
scritto:

> Hello
>
> I have a sample file as below and we would need to remove the spaces
>
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
> 000645|VHO CASILLERO DIABLO |PINOT NOIR 750ML  |
>
> i have coded as below
>
>
> SORT FIELDS=COPY
> INREC OVERLAY=(001:001,010,UFF,M10,LENGTH=10,
>012:012,025,UFF,M10,LENGTH=25,
>038:038,025,UFF,M10,LENGTH=25,
>001:001,2500,SQZ=(SHIFT=LEFT))
>
> but the output i am getting is as below
>
>
>
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
> 645|0|750|CASILLERODELDIABLO|VHOCASILLERODIABLO|
>
> here we can see that the data "VHO CASILLERO DIABLO  " spaces also got
> removed . is there a way we can get data as follows
>
> 000645|VHO CASILLERO DIABLO|PINOT NOIR 750ML|
>
> Could some let me know how this can be done ?
>
> Thanks.
> Ron T
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN