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
 

 

Can i use renamed data item in the arithmetic operations?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Aug 21, 2008 11:02 am    Post subject: Can i use renamed data item in the arithmetic operations?
Reply with quote

hi,
Can i use renamed data item in arithmetic operations?
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Aug 21, 2008 11:12 am    Post subject:
Reply with quote

Hello maridawson,

What do u mean by renaming data item ?
Can you provide an example?
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Thu Aug 21, 2008 11:26 am    Post subject:
Reply with quote

suppose if i rename a data item like in the following ex:

01 ws00-input.
05 ws-in1.
10 ws-in11 pic x(2).
10 ws-in12 pic x(2).
05 ws-in2.
10 ws-in21 pic x(2).
10 ws-in22 pic x(2).
05 ws-in3 pic x(1).
66 ws-ren renames ws-in12 thru ws-in22.

now can i use ws-ren in arithmetic operations like add,sub,multiply,divide?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 21, 2008 12:02 pm    Post subject:
Reply with quote

if you try it will give error
Code:
Receiving operand "WS-REN (GROUP)" of an arithmetic statement was neither
numeric nor numeric-edited.

maxcc 12



are you sure the fields are alphanumeric??
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Thu Aug 21, 2008 12:27 pm    Post subject:
Reply with quote

66 items are one of those cobol things that 'is suggested not to use'. It is only slightly less dangerous than MOVE CORR.

Look at your compile listing and you will see that:
1) RENAMES creates a Group item with an ALPHANUMERIC attribute.

2) The length will be equal to that of all the elementary items referenced in the RENAMES clause.

The basic use of RENAMES is to allow MOVEs of elementary items as a group.

As Sambhaji showed, not applicable for arithmetic functions.
Back to top
View user's profile Send private message
maridawson

New User


Joined: 24 Jun 2008
Posts: 59
Location: chennai

PostPosted: Fri Aug 22, 2008 3:39 pm    Post subject:
Reply with quote

can we use renamed elementary data item for arithmetic operations ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri Aug 22, 2008 4:43 pm    Post subject:
Reply with quote

According to the manual, a renamed elementary numeric item remains a numeric item and hence could be used for arithmetic operations. Renamed group items are alphanumeric, however.
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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