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
 

 

Convertion to COMP numeric field in COBOL.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Convertion to COMP numeric field in COBOL.
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: 2150
Location: At my coffee table

PostPosted: Mon Mar 30, 2009 4:47 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Mar 30, 2009 4:49 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 30, 2009 9:40 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


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