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.
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.
Joined: 08 Sep 2003 Posts: 32 Location: Toronto <-> Bangalore
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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: