IBM Z and LinuxONE IBM Z

IBM Z

The enterprise platform for mission-critical applications brings next-level data privacy, security, and resiliency to your hybrid multicloud.


#Servers
#IBMZ
#Enterpriseserver
 View Only
  • 1.  z/OS ICEMAN V3R1 - Remove Blanks in Pipe-Delimited file

    Posted 07/15/26 12:20 PM
    Edited by Girish Sajja 07/15/26 09:54 PM

    Hi,

    I am trying to remove blank spaces between a pipe-delimited file with the SQZ=RIGHT,TRAIL=C'|' option.  But the output still has the blank spaces.

    The following statements seem to have done the trick:

      INREC  IFOUTLEN=80,
      IFTHEN=(WHEN=(26,1,CH,EQ,C'|'),
        PARSE=(%01=(ENDBEFR=C'|',FIXLEN=25),
               %02=(ENDAT=C'|',FIXLEN=23),
               %03=(ENDAT=C'|',FIXLEN=8),
               %04=(ABSPOS=59,FIXLEN=20)),
             BUILD=(%01,SQZ=(SHIFT=LEFT,TRAIL=C'|'),
                    %02,SQZ=(SHIFT=LEFT,MID=X'00'),
                    %03,SQZ=(SHIFT=LEFT,TRAIL=C'|'),
                    %04,SQZ=(SHIFT=LEFT,MID=X'00')))
      OUTREC FINDREP=(IN=C' ',OUT=C'')

    Any assistance with this matter would be greatly appreciated.

    Thank you.



    ------------------------------
    Girish Sajja
    ------------------------------



  • 2.  RE: z/OS ICEMAN V3R1 - Remove Blanks in Pipe-Delimited file

    Posted 07/16/26 07:24 AM

    I was confused at first by this, because the last line says "Any assistance with this matter would be greatly appreciated."

    The only thing you might want to add to your solution is ahead of the INREC line add the line "SORT FIELDS=COPY" because it makes it clear this is a copy/reformat job and not a sort, potentially your solution will abend or throw an error on some systems/configurations, without it.



    ------------------------------
    Paul DeLessio
    ------------------------------



  • 3.  RE: z/OS ICEMAN V3R1 - Remove Blanks in Pipe-Delimited file

    Posted 07/16/26 11:21 AM

    Hi,

    Pardon the confusion.  Right after I posted the question, I was able to figure out that the parsing had to use the variable length syntax.

    As per your suggestion, the COPY needs to be specified.  The above statements were part of an ICETOOL step using the COPY function.

    Thank you very much.



    ------------------------------
    Girish Sajja
    ------------------------------