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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm


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