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
 

 

How to remove spaces between fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
pavanchandana

New User


Joined: 05 Sep 2008
Posts: 15
Location: Hyderabad

PostPosted: Thu Mar 10, 2011 11:02 am    Post subject: How to remove spaces between fields
Reply with quote

Hi All,

Can you help me, how to remove the spaces between the fields.

There is a table field of VARCHAR(254) which need to be written to an output VB file.

Example:
Actual table value: PRUDENTIAL (ten spaces) 5.875% NOTES 11/5/2029 GBP(VAR)

Expected output value: PRUDENTIAL 5.875% NOTES 11/5/2029 GBP(VAR)

Please help me how to code it in a cobol program.

Thank you
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 10, 2011 12:18 pm    Post subject:
Reply with quote

well db2 tables do not have fields, they have columns.

and when varchar columns are selected by imbedded sql in a cobol program,
the length of the varchar is placed in the first 49-level and the actual data is placed in the second 49-level.

now, if the varchar column was correctly inserted/updated the length should provide you the necessary information.

in addition, you say you want to remove spaces between the fields.
what are you talking about?
suggest you provide a data description (use CODE tags) for the output variable length record,
and exactly what are your expectations?
Back to top
View user's profile Send private message
sureshmanokar

New User


Joined: 21 Dec 2010
Posts: 11
Location: Bangalore

PostPosted: Thu Mar 10, 2011 6:12 pm    Post subject: Reply to: How to remove spaces between fields
Reply with quote

I think you are fetching column values from table (which has excess spaces) and using those values in your program.

If yes, pass those values to the local variables and remove the spaces using

UNSTRING L-VAR-UNSTR DELIMITED BY SPACES INTO L-VAR-NAME-1, L-VAR-NAME-2, ....etc
Back to top
View user's profile Send private message
pavanchandana

New User


Joined: 05 Sep 2008
Posts: 15
Location: Hyderabad

PostPosted: Fri Mar 11, 2011 5:09 pm    Post subject: Reply to: How to remove spaces between fields
Reply with quote

Thank you. I have built an logic...it met my requirement....
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am


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