IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

OMIT Spaces


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Wed Sep 16, 2009 11:50 am
Reply with quote

Hii all,

I am having an input file of LRECL = 80, FB. Please find a sample file below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
21524*#limited comp     *#1111*#abc comp ltd    *#O   *#6012
05555*#                 *#    *#New York         *#   *#   


I need the output like below,
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
21524*#limited comp*#1111*#abc comp ltd*#O*#6012
05555*#*#*#New York*#   


I used the sort
OPTION COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))
and it is squeezing all the spaces.
But i need space between words like "abc comp ltd".

The logic i suppose is Omitting out the spaces present befor the symbol/delimiter "*#" in each field.
Please help me out if someone has sample code to accomplish this.

Note :- Dont know how may fields ll be there and the length of the fields might differ.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 16, 2009 7:41 pm
Reply with quote

Hello,

You need to post the rule that determines which space(s) should be removed and which should be kept. . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 16, 2009 9:33 pm
Reply with quote

Niki,

I believe a DFSORT job like the following will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
21524*#limited comp     *#1111*#abc comp ltd    *#O   *#6012
05555*#                 *#    *#New York        *#    *#
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(1,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
           7,18,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=20),X,
          26,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
          32,17,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=19),X,
          50,5,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=7),X,
          56,10,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=12),
          80:X)),
    IFTHEN=(WHEN=INIT,
      BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C'*',PAIR=QUOTE))),
    IFTHEN=(WHEN=INIT,
      FINDREP=(IN=C'"',OUT=C''))
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top