View previous topic :: View next topic
|
Author |
Message |
pavanchandana
New User
Joined: 05 Sep 2008 Posts: 15 Location: Hyderabad
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
sureshmanokar
New User
Joined: 21 Dec 2010 Posts: 11 Location: Bangalore
|
|
|
|
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 |
|
|
pavanchandana
New User
Joined: 05 Sep 2008 Posts: 15 Location: Hyderabad
|
|
|
|
Thank you. I have built an logic...it met my requirement.... |
|
Back to top |
|
|
|