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

Moving fields to a new file after truncating the spaces


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

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Tue Oct 03, 2006 5:45 pm
Reply with quote

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
View user's profile Send private message
cooolguy

New User


Joined: 05 Sep 2006
Posts: 9

PostPosted: Tue Oct 03, 2006 8:20 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Oct 03, 2006 8:53 pm
Reply with quote

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:

Code:

A|BC|CD|DEF|DF|


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
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 FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top