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

Is it possible to do type conversion in easytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bijumon

New User


Joined: 14 Aug 2006
Posts: 20
Location: Pune,India

PostPosted: Wed Aug 01, 2007 1:12 pm
Reply with quote

Hi, Is it possible to do type a conversion in easytrieve, i need to convert an alphanumeric item containing a numeric value to a numeric variable, but when i am using the move statement it is not working.
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Aug 01, 2007 2:46 pm
Reply with quote

Show us input and expected output also what you have coded so far then somebody might offer a solution.
Back to top
View user's profile Send private message
bijumon

New User


Joined: 14 Aug 2006
Posts: 20
Location: Pune,India

PostPosted: Wed Aug 01, 2007 4:26 pm
Reply with quote

thanks for your reply, i have found the solution for it using tables.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Aug 01, 2007 4:54 pm
Reply with quote

bijumon wrote:
thanks for your reply, i have found the solution for it using tables.
OK, you got me....Tables? How?
Back to top
View user's profile Send private message
bijumon

New User


Joined: 14 Aug 2006
Posts: 20
Location: Pune,India

PostPosted: Wed Aug 01, 2007 5:19 pm
Reply with quote

I was seperating the numeric value from the PICTURE clause in COBOL declarations, and i was doing this using tables, i.e, when the character in the input table containing the COBOL layout was '(' char, I moved the remaining values into another output alphanumeric table until i found the end which is ')' char. The output table was of 5 chars length, i redefined it 5 times, and dependig on what was the value of a counter, which I increamented when ever a value was moved into the output table, and used the corresponding redefined numeric variable.


The Input table is:

Code:

CBL2EZT-VAR-TBL                          W   64    A   
CBL2EZT-VAR-TABLE     CBL2EZT-VAR-TBL         1    A OCCURS 64   


The Input table is:

Code:

CBL2EZT-CBL-PIC                          W   05    A VALUE ' '       
CBL2EZT-CBL-PIC-TAB   CBL2EZT-CBL-PIC        01    A OCCURS 05       
CBL2EZT-CBL-PIC-NUM1  CBL2EZT-CBL-PIC        01    N VALUE 0         
CBL2EZT-CBL-PIC-NUM2  CBL2EZT-CBL-PIC        02    N VALUE 0         
CBL2EZT-CBL-PIC-NUM3  CBL2EZT-CBL-PIC        03    N VALUE 0         
CBL2EZT-CBL-PIC-NUM4  CBL2EZT-CBL-PIC        04    N VALUE 0         
CBL2EZT-CBL-PIC-NUM5  CBL2EZT-CBL-PIC        05    N VALUE 0
Back to top
View user's profile Send private message
bijumon

New User


Joined: 14 Aug 2006
Posts: 20
Location: Pune,India

PostPosted: Wed Aug 01, 2007 5:19 pm
Reply with quote

Please do post a reply if am still not clear.
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: Wed Aug 01, 2007 7:05 pm
Reply with quote

Hello,

What would happen to a field defined like this?
Code:
77  SOME-FIELD          PIC 9(01)99V99(3).


While you probably won't have anything that far from simple, it is completely valid to the compiler.

My thought is that not everything is bound by () and sometimes there is more than one set of () and i just wanted to offer a heads-up.
Back to top
View user's profile Send private message
bijumon

New User


Joined: 14 Aug 2006
Posts: 20
Location: Pune,India

PostPosted: Thu Aug 02, 2007 10:59 am
Reply with quote

Hi Dick,

Hmmmm, I never thought of that thing, since in our company the standards wont let you define a filed that way, but if a field which is having a decimal point coming in then my logic wont work, thanks for the heads up. That declaration just proved that my loginc was not a generic one.

----------------
Regards,
Biju.
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: Thu Aug 02, 2007 6:22 pm
Reply with quote

You're welcome.

And with a bit more code, it will handle the decimal as well icon_smile.gif
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts SMF record type 30 JCL & VSAM 8
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top