Home > Ask the Data Center Experts > CICS Questions & Answers > Failed arithmetic operations on CICS programs written in C
Ask The Data Center Expert: Questions & Answers
EMAIL THIS

Failed arithmetic operations on CICS programs written in C

Robert Crawford EXPERT RESPONSE FROM: Robert Crawford

Pose a Question
Other Data Center Categories
Meet all Data Center Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 30 December 2006
When I write a CICS program in C language the arithmetic operations are not working in CICS execution. I am receiving two values from CICS and doing addition. The addition statement alone is not working. What is going on?

>
EXPERT RESPONSE
There are several points where things may go haywire so you're not adding the right things together:
  • Are you receiving the numbers in EBCDIC? If so, ensure the logic that converts the number string into binary works correctly. Also double-check the input fields' offsets and lengths to make sure the conversion logic doesn't include garbage.
  • There could be a storage alignment problem if you are working with multiple structures or using something like memcpy() to get the number into a variable.
  • Remember that native C doesn't support packed decimal numbers. Therefore, if you are trying to add two packed numbers you must use special IBM or custom written routines.

    In any case, you will have to find some way to examine your program execution at the time of the addition with a debugging tool. If you don't have a debugging tool you can try forcing an ABEND either right before or after the offending statement.


  • Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


    RELATED CONTENT
    CICS
    Which MQ Queue is related with which CICS transaction?
    Can a program use IXLLIST macros in CICS?
    VSAM files in CICS -- Batch report help
    Reading VSAM data from different LPARs
    Finding executed statements in CICS
    Submitting a batch job from CICS
    Automating FTP transfers to AIX
    FTP a dataset from MVS to Linux
    Mainframe FTP - A simple check
    Does replicating DB2 tables into CICS tables affect CPU usage?

    RELATED RESOURCES
    2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
    Search Bitpipe.com for the latest white papers and business webcasts
    Whatis.com, the online computer dictionary



    Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice

    HomeNewsTopicsITKnowledge ExchangeTipsBlogsMultimediaWhite PapersEvents
    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    SEARCH 
    TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




    All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
      TechTarget - The IT Media ROI Experts