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
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


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