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
 

 

Trailing space needs to be removed.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Wed May 03, 2006 10:50 am    Post subject: Trailing space needs to be removed.
Reply with quote

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

Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Wed May 03, 2006 11:04 am    Post subject:
Reply with quote

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

DFSORT Moderator


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

PostPosted: Wed May 03, 2006 8:17 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
Back to top
View user's profile Send private message
Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Thu May 04, 2006 10:01 am    Post subject:
Reply with quote

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

DFSORT Moderator


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

PostPosted: Thu May 04, 2006 9:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm


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