View previous topic :: View next topic
|
Author |
Message |
Ayyappan
New User
Joined: 05 Jul 2005 Posts: 31 Location: India
|
|
|
|
Hi,
My input file is having trailing spaces in all the fields and it needs to be removed. Can anyone help me in this?
My sample input file is,
Code: |
----+----1----+----2----+----3----+----4----+----5--
********************************* Top of Data ******
0001595636 ,Swartzer ,JimmyJohn
0001612340 ,Elliott ,JimmyJohn
0001825645 ,Ontko ,JimmyJohn
|
My required output is,
Code: |
0001595636,Swartzer,JimmyJohn
0001612340,Elliott,JimmyJohn
0001825645,Ontko,JimmyJohn
|
Can anyone help me in getting this output using sort or Eztrieve program? |
|
Back to top |
|
|
Ayyappan
New User
Joined: 05 Jul 2005 Posts: 31 Location: India
|
|
|
|
The input file is a fixed length file and the layout is,
Fieldname Position
E_num 1-11
filler 12-12
Last_name 13-42 (If the last name field is having say 10 characters, then remaining 20 characters are having spaces and I want to remove them.)
filler 43-43
Fist_name 44-80
When I posted the input sample, the spaces got removed. Hence I am giving the layout.
The required output should not have any trailing spaces. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use the new SQZ function available with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) to do this quite easily. If you don't have the April, 2006 DFSORT PTF installed, ask your System Programmer to install it. Here's the DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT))
/*
|
For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Ayyappan
New User
Joined: 05 Jul 2005 Posts: 31 Location: India
|
|
|
|
Hi Frank,
Thanks for your reply. But in my shop I have only syncsort not dfsort. Hence I am getting syntax error if I use BUILD command. So, I used the following Eztrieve.
FILE INPUT
REC-IN 01 132 A
IN-EMPLID 01 11 A
IN-LAST-NAME 12 31 A
IN-FIRST-NAME 43 31 A
DEFINE WHOLE-THING W 134 A
DEFINE SECOND-PART W 134 A
DEFINE CONCAT-HOLD W 134 A
DEFINE CONCAT-SCAN CONCAT-HOLD 1 A INDEX CONCAT-NDX
DEFINE CONCAT-LENGTH W 2 P 0
JOB INPUT (INPUT)
WHOLE-THING = IN-EMPLID
SECOND-PART = IN-LAST-NAME
PERFORM CONCAT-NOSPACE
SECOND-PART = IN-FIRST-NAME
PERFORM CONCAT-NOSPACE
DISPLAY WHOLE-THING
CONCAT-NOSPACE. PROC
CONCAT-NDX = 133
CONCAT-HOLD = WHOLE-THING
DO WHILE CONCAT-SCAN EQ ' ' AND CONCAT-NDX GE 0
CONCAT-NDX = CONCAT-NDX - 1
END-DO
CONCAT-NDX = CONCAT-NDX + 1
CONCAT-LENGTH = 133 - CONCAT-NDX
MOVE SECOND-PART TO CONCAT-SCAN CONCAT-LENGTH
WHOLE-THING = CONCAT-HOLD
END-PROC |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
in my shop I have only syncsort not dfsort. Hence I am getting syntax error if I use BUILD command |
My job works fine with DFSORT. Syncsort does NOT support BUILD (although it does support the alias FIELDS) or SQZ. |
|
Back to top |
|
|
|