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
 

 

Is it possible to do type conversion in easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Is it possible to do type conversion in easytrieve
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    Post subject: Re: Tyep conversion in easytrieve!!!
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    Post subject: Re: Is it possible to do type conversion in easytrieve
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: 3158
Location: Tucson AZ

PostPosted: Wed Aug 01, 2007 4:54 pm    Post subject: Re: Is it possible to do type conversion in easytrieve
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    Post subject: Re: Is it possible to do type conversion in easytrieve
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    Post subject: Re: Is it possible to do type conversion in easytrieve
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

Site Director


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

PostPosted: Wed Aug 01, 2007 7:05 pm    Post subject:
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    Post subject: Re: Is it possible to do type conversion in easytrieve
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

Site Director


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

PostPosted: Thu Aug 02, 2007 6:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Ccompar BLOB (images of type jpg) on ... nihad DB2 0 Sun Feb 05, 2017 3:13 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am


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