query in move COMP value to NUMERIC in easytrieve

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Post Reply
Avani
Member
Posts: 2
Joined: Wed Apr 04, 2007 4:34 pm

query in move COMP value to NUMERIC in easytrieve

Post by Avani » Wed Apr 04, 2007 6:44 pm

have a query in eazytrieve. In one of my codes, I need to move COMP value to NUMERIC and vice versa.

It populates junk values when I try to do that move.

If you can throw some light on this issue,it?ll be really helpful.

Thanks
Naru
Reply With Quote

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Apr 04, 2007 8:02 pm

an assignment (field-b = field-a) will move and convert
a move (move field-a to field-b) will not convert, only move the data from one address to another.

links:
http://www.easytrieveplus.com/prog_chapter2.html#2.11
http://www.easytrieveplus.com/prog_chapter2.html#2.11.2
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Thu Apr 05, 2007 5:00 am

Naru,

As dbzTHEdinosauer said you need to see what is your code
an assignment or a move.

I donot see any problem with the below code.

Code: Select all



PARM  ABEXIT(SNAP) PRESIZE 1024                                         
*                                                                       
 DEFINE WS-COMPFLD-A   W   3 P VALUE 12345.                             
 DEFINE WS-COMPFLD-B   W   3 P VALUE 0.                                 
*                                                                       
 DEFINE WS-NUMFLD-A    W   5 N VALUE 12345.                             
 DEFINE WS-NUMFLD-B    W   5 N VALUE 0.                                 
*                                                                       
**********************************************************************  
*                          PROCESSING                                *  
**********************************************************************  
*                                                                       
JOB INPUT (NULL)                                                        
*                                                                       
    WS-COMPFLD-B = WS-NUMFLD-A                                          
    WS-NUMFLD-B  = WS-COMPFLD-A                                         
*                                                                       
    DISPLAY ' VALUES  INITAL '                                          
    DISPLAY ' COMPFLD-A    '  WS-COMPFLD-A                              
    DISPLAY ' WS-NUMFLD-A  '  WS-NUMFLD-A                               
*                                                                       
    DISPLAY ' VALUES AFTER MOVE '                                       
    DISPLAY ' COMPFLD-B    '  WS-COMPFLD-B                              
    DISPLAY ' WS-NUMFLD-B  '  WS-NUMFLD-B                               
*                                                                       
STOP                                                                    


Result:
******

VALUES  INITAL     
******************
COMPFLD-A      12345 
WS-NUMFLD-A  12345 

VALUES AFTER MOVE  
******************
COMPFLD-B      12345 
WS-NUMFLD-B  12345

 
Thanks,
Veera.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others