Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing spaces in a record, but not all

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Removing spaces in a record, but not all
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: 1439
Location: Bangalore,India

PostPosted: Sun Dec 02, 2007 4:34 pm    Post subject:
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 Moderator


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

PostPosted: Sun Dec 02, 2007 10:25 pm    Post subject:
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    Post subject: Reply to: Removing spaces in a record, but not all
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 Moderator


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

PostPosted: Mon Dec 03, 2007 10:54 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Reply to: Removing spaces in a record, but not all
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us