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

Removing spaces in a record, but not all


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

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Sun Dec 02, 2007 2:28 am
Reply with quote

Hi,

Below is my input file records

OUTFIL FNAMES=DIRETEN1, INCLUDE=(54,6,CH,EQ,C' 1 ',AND,61,6,CH,GE,C' 234 ',AND,61,6,CH,LE,C' 12 ')
OUTFIL FNAMES=DIRETEN2, INCLUDE=(54,6,CH,EQ,C' 3453 ',AND,61,6,CH,GE,C' 34433 ',AND,61,6,CH,LE,C' 1124 ')

I want to remove all the blanks in the records except the blank space that is in 1st position (1st character of each record is a blank space) and after "DIRETEN1". Please note that number of spaces inside the INCLUDE parameters and size of numeric fields inside INCLUDE parameters may vary from record to record. (i.e.) in first record, I have C' 1 ' and in second record, I have C' 3453 '. Your help is appreciated.

Thanks,
Karthik.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Sun Dec 02, 2007 4:34 pm
Reply with quote

Karthik,

Quote:
I want to remove all the blanks in the records except the blank space that is in 1st position (1st character of each record is a blank space) and after "DIRETEN1". Please note that number of spaces inside the INCLUDE parameters and size of numeric fields inside INCLUDE parameters may vary from record to record. (i.e.) in first record, I have C' 1 ' and in second record, I have C' 3453 '. Your help is appreciated.

Sorry Im c icon_confused.gif nfused?

Explain your problem clearly with examples!!!!
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: Sun Dec 02, 2007 10:25 pm
Reply with quote

Karthik,

Here's a DFSORT job that will do what I think you asked for. I assumed your input file has RECFM=FB and LRECL=124, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=..  input file (FB/124)
//SORTOUT DD DSN=...  output file (FB/124)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(26:26,99,SQZ=(SHIFT=LEFT))
/*


SORTOUT will have:

OUTFIL FNAMES=DIRETEN1, INCLUDE=(54,6,CH,EQ,C'1',AND,61,6,CH,GE,C'234',AND,61,6,CH,LE,C'12')
OUTFIL FNAMES=DIRETEN2, INCLUDE=(54,6,CH,EQ,C'3453',AND,61,6,CH,GE,C'34433',AND,61,6,CH,LE,C'1124')

with a blank in position 1 for each OUTFIL statement.

If that's not what you want, then please explain more clearly what you do want.
Back to top
View user's profile Send private message
karthikbabudh

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Mon Dec 03, 2007 10:05 pm
Reply with quote

Frank,

Your code gave me the expecected output. Thanks, but can you tell me in detail about the parameters used in OVERLAY. (26:26,99,SQZ=(SHIFT=LEFT)). What exactly is 26:26,99 here? I have same type of requirements in which I have to remove blanks at different positions.

Thanks,
Karthik.
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: Mon Dec 03, 2007 10:54 pm
Reply with quote

Code:

  INREC OVERLAY=(26:26,99,SQZ=(SHIFT=LEFT))


Tells DFSORT to overlay 99 characters starting in position 26 -> overlays positions 26-124 by shifting those characters to the left and squeezing out any blanks. The resulting value is padded with blanks on the right as needed.

26: says to start in position 26.

26,99 says to operate on the characters in 26-124.

As a simpler example, if you had:

Code:

RECORD1  ABC   DEF   GHI


and you used:

Code:

  INREC OVERLAY=(10:10,15,SQZ=(SHIFT=LEFT)) 


the output would be:

Code:

RECORD1  ABCDEFGHI


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
karthikbabudh

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Mon Dec 03, 2007 11:52 pm
Reply with quote

Thank you so much for your detailed description with example Frank.

Karthik.
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 Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts BPXBATCH SFTP to remote path having s... All Other Mainframe Topics 6
Search our Forums:

Back to Top