View previous topic :: View next topic
|
Author |
Message |
bonniem
New User
Joined: 09 Aug 2005 Posts: 67
|
|
|
|
Hi,
I have an input file which has 5 fields with pipe character "|" separating them. Theese fields might contain spaces, my requirement is to move these fields to a new file after truncating the spaces. There is no specific position where the spaces start for a field.
For example if my input file is "A |BC |CD |DEF |DF |"
I want output file as A|BC|CD|DEF|DF.
Thanks,
Bonnie |
|
Back to top |
|
|
cooolguy
New User
Joined: 05 Sep 2006 Posts: 9
|
|
|
|
How big is the file?
If it is not big then use change all command
i.e. C ALL ' ' ''
This will do the work you need |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Bonnie,
You can do this quite easily with DFSORT's new SQZ function. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. Here's the job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A |BC |CD |DEF |DF |
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))
/*
|
SORTOUT would have:
You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's SQZ function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|