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
 

 

Zero Suppression

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Fri May 06, 2011 10:30 am    Post subject: Zero Suppression
Reply with quote

Hi ,

Here is the requirement. I have to fetch 3 columns from table
Table
Col1 x(2) -- AB
col2 9(5) -- 05678
Col3 x(2) -- CD
Iam fetching these 3 cols and writing to one variable as one Key. AB05678CD. Is there any way to suppress the Zero in the middle.

I tried INSPECT which only gets me to spaces i.e 'AB 5678CD'.
I am curious to know if there is any other way. not to mention I also tried reference modification. wondering if there is any other way.

------------------------------------------------------------------------------------
P.s: I did a search for this in the forum but I couldnt. If there is any link please do let me know . I ll take over from there.


Thanks a bunch in advance!!
Back to top
View user's profile Send private message

GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Fri May 06, 2011 12:11 pm    Post subject:
Reply with quote

Code:
select col1 !! strip(char(col2)) !! col3 from ...
Back to top
View user's profile Send private message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Tue May 10, 2011 12:29 pm    Post subject: TO GuyC
Reply with quote

HI ,
Sorry about the late response. I got disconnected and could nt come back.

So can i do the above requirement in COBOL ?

To GUYC , the code pasted by you .. could you please explain. its little unclear to me .

Thanks a bunch in advance!!

-RJ ( job1919)
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Tue May 10, 2011 1:01 pm    Post subject:
Reply with quote

Nothing to explain.
This is the DB2 part of the forum so i did it in SQL.
Lookup the DB2 functions :
Char()
strip()
and the operator concat
Back to top
View user's profile Send private message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Tue May 10, 2011 2:51 pm    Post subject:
Reply with quote

ok .. Thanks GUYC I ll have a look at them.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Zero Suppression with DB2 SQL Occitiger DB2 4 Mon Feb 01, 2010 11:19 pm
No new posts space suppression mf_karthik COBOL Programming 13 Thu Nov 05, 2009 8:47 pm
No new posts Leading spaces suppression Robert Sample COBOL Programming 3 Wed Oct 14, 2009 4:03 pm
No new posts VB File handling with suppression of ... shell100 COBOL Programming 4 Fri Mar 13, 2009 5:08 pm
No new posts Suppression of trailing spaces in giv... shell100 COBOL Programming 6 Fri Mar 13, 2009 4:23 pm


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