IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convertion to COMP numeric field in COBOL.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Mon Mar 30, 2009 4:35 pm
Reply with quote

Hi,

How to convert numeric to COMP field in COBOL.

I have a variable
05 Ws-year
10 ws-cc pic 9(2).
10 ws-yy pic 9(2).
05 ws-new-year PIC 9(4) comp.

I need to move ws-year to ws-new-year to be used in a sql statement to compare the values in a table.
Can anyone plz help
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Mar 30, 2009 4:47 pm
Reply with quote

Compute ws-new-year = ws-cc * 100 + ws-yy?
Move ws-year to ws-new-year?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Mar 30, 2009 4:49 pm
Reply with quote

Hi,

Have you searched the Forum?
Back to top
View user's profile Send private message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Mon Mar 30, 2009 5:08 pm
Reply with quote

Hi Anuj,

thanks for the reply. I did search in the forum.
Most of queries were raised on Comp-3 or conversion from Comp to other datastypes.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 30, 2009 9:40 pm
Reply with quote

Hello,

Curious. . . icon_confused.gif - you mention the reply from Anuj, but not the one from CG that gave solutions. . .

Did you try the alternatives CG posted?

Is this now working?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top