<br />
<b>Warning</b>:  Undefined array key "global_protection_id" in <b>/home/wikitechy/public_html/interview-questions/wp-content/plugins/content-protector/inc/class-ps-rest-handler.php</b> on line <b>51</b><br />
{"id":1033,"date":"2021-07-19T10:08:14","date_gmt":"2021-07-19T10:08:14","guid":{"rendered":"https:\/\/www.wikitechy.com\/interview-questions\/?p=1033"},"modified":"2021-09-09T06:27:29","modified_gmt":"2021-09-09T06:27:29","slug":"what-is-the-difference-between-comp-and-comp-3-usage","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/","title":{"rendered":"What is the difference between comp and comp-3 usage ?"},"content":{"rendered":"<div class=\"TextHeading\">\n<div class=\"hddn\">\n<h2 id=\"comp\" class=\"color-pink\" style=\"text-align: justify;\"><span style=\"font-family: inherit; font-size: 2rem;\">Comp :<\/span><\/h2>\n<\/div>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>COMP is 2 bytes.<\/li>\n<li>COMP is used for Binary Representation it allows only S and 9.<\/li>\n<li>COMP stores the data in the binary format.<\/li>\n<li>With COMP fields, you have to drag out a calculator and convert the hex value to find out the true value that is being used in a program.<\/li>\n<li>Memory usage is,\n<ul>s9(5)-s9(9) &#8211; 4bytes<\/ul>\n<ul>s9(1)-s9(4) &#8211; 2bytes<\/ul>\n<ul>s9(10)-s9(18) &#8211; 8bytes<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"text-center row\" style=\"text-align: justify;\"><\/div>\n<div class=\"subheading\" style=\"text-align: justify;\">\n<h2 id=\"comp-3\" class=\"color-blue\">Comp-3<\/h2>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>COMP-3 is 8 bytes.<\/li>\n<li>Comp-3 is used for Packed Decimal values it allows S 9 V mostly it is useful for Decimal Calculation Values.<\/li>\n<li>COMP-3 stores the data in the BCD(Binary Coded Decimal)format.<\/li>\n<li>It is used to avoid rounding issues that occur when binary numbers are used to represent decimal fractions.<\/li>\n<li>This is particularly vital in systems that method massive volumes of economic transactions\/amounts<\/li>\n<li>Memory usage is\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>n\/2 + 1 (Even)<\/ul>\n<\/li>\n<\/ul>\n<ul>n+1\/2 (odd)<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"subheading\" style=\"text-align: justify;\">\n<h2 id=\"example\">Example :<\/h2>\n<\/div>\n<div class=\"Content\" style=\"text-align: justify;\">\n<div class=\"hddn\">\n<ul>\n<li>Banking, Credit cards, etc.<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"subheading\" style=\"text-align: justify;\">\n<h2 id=\"other-cobol-usages\">Other cobol usages :<\/h2>\n<\/div>\n<div class=\"Content\">\n<div class=\"hddn\">\n<ul>\n<li style=\"text-align: justify;\">The usage clause specifies how the data item being stored internally .If no usage clause specified , the default usage clause would Usage is display<\/li>\n<\/ul>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Answer : COMP is 2 bytes.COMP-3 is 8 bytes&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"passster_activate_protection":false,"passster_protect_child_pages":"","passster_protection_type":"password","passster_password":"","passster_activate_overwrite_defaults":"","passster_headline":"","passster_instruction":"","passster_placeholder":"","passster_button":"","passster_id":"","passster_activate_misc_settings":"","passster_redirect_url":"","passster_hide":"no","passster_area_shortcode":"","gtb_hide_title":false,"gtb_wrap_title":false,"gtb_class_title":"","gtb_remove_headerfooter":false,"footnotes":""},"categories":[7120],"tags":[195,491,360,203,199,214,363,7137,7125,7123,209,7145,7141,7142,7144,7153,7146,7143,7133,7130,7149,7147,7148,7151,7135,7128,7154,7150,7152,205,2936,222,7138,7122,196,212,213,710,207,366,361,204,7140,7139,282,367,7127,7124,206,7136,7155,200,7131,197,7134,7126,7132,280,364,7129,7121,7156,15916,285],"class_list":["post-1033","post","type-post","status-publish","format-standard","hentry","category-cobol","tag-accenture-interview-questions-and-answers","tag-applied-materials-interview-questions-and-answers","tag-atos-interview-questions-and-answers","tag-capgemini-interview-questions-and-answers","tag-casting-networks-india-pvt-limited-interview-questions-and-answers","tag-cgi-group-inc-interview-questions-and-answers","tag-ciena-corporation-interview-questions-and-answers","tag-cobol-binary-data-type","tag-cobol-comp-3-sign","tag-cobol-comp-3-to-numeric","tag-collabera-technologies-interview-questions-and-answers","tag-comp","tag-comp-1","tag-comp-2","tag-comp-cobol","tag-comp-data-type-in-cobol","tag-comp-fields-in-cobol","tag-comp-in-cobol","tag-comp-in-cobol-with-example","tag-comp-in-cobol-with-examples","tag-comp-in-mainframe","tag-comp-one","tag-comp-storage-in-cobol","tag-comp-values-in-cobol","tag-comp-1-example-in-cobol","tag-comp-3-converter","tag-comp1-comp2-comp3","tag-comp3","tag-comp4","tag-dell-international-services-india-pvt-ltd-interview-questions-and-answers","tag-fis-global-business-solutions-india-pvt-ltd-interview-questions-and-answers","tag-flipkart-interview-questions-and-answers","tag-how-to-display-comp-variables-in-cobol","tag-how-to-display-comp-3-variable-in-cobol","tag-ibm-interview-questions-and-answers","tag-indecomm-global-services-interview-questions-and-answers","tag-infosys-technologies-interview-questions-and-answers","tag-mavenir-interview-questions-and-answers","tag-mphasis-interview-questions-and-answers","tag-netapp-interview-questions-and-answers","tag-opentext-technologies-interview-questions-and-answers","tag-oracle-corporation-interview-questions-and-answers","tag-packed-decimal-in-cobol","tag-packed-decimal-to-numeric-conversion-in-cobol","tag-persistent-systems-interview-questions-and-answers","tag-rbs-india-development-centre-pvt-ltd-interview-questions-and-answers","tag-s94-comp-how-many-bytes","tag-s94-comp-3-how-many-bytes","tag-sap-labs-india-pvt-ltd-interview-questions-and-answers","tag-should-have-usage-display","tag-societe-generale-global-solution-center-interview-questions-and-answers","tag-tech-mahindra-interview-questions-and-answers","tag-types-of-usage-clause-in-cobol","tag-unitedhealth-group-interview-questions-and-answers","tag-usage-binary-in-cobol","tag-usage-clause-in-cobol","tag-usage-is-display-in-cobol","tag-virtusa-consulting-services-pvt-ltd-interview-questions-and-answers","tag-wells-fargo-interview-questions-and-answers","tag-when-to-use-comp-and-comp3-in-cobol","tag-when-to-use-comp-in-cobol","tag-wipro-infote-interview-questions-and-answers","tag-xansa-interview-questions-and-answers","tag-xoriant-solutions-pvt-ltd-interview-questions-and-answers"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is the difference between comp and comp-3 usage ? - Cobol<\/title>\n<meta name=\"description\" content=\"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the difference between comp and comp-3 usage ? - Cobol\" \/>\n<meta property=\"og:description\" content=\"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/\" \/>\n<meta property=\"og:site_name\" content=\"Wikitechy\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-19T10:08:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-09T06:27:29+00:00\" \/>\n<meta name=\"author\" content=\"Editor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Editor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/\",\"name\":\"What is the difference between comp and comp-3 usage ? - Cobol\",\"isPartOf\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\"},\"datePublished\":\"2021-07-19T10:08:14+00:00\",\"dateModified\":\"2021-09-09T06:27:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\"},\"description\":\"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#website\",\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/\",\"name\":\"Wikitechy\",\"description\":\"Interview Questions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757\",\"name\":\"Editor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g\",\"caption\":\"Editor\"},\"url\":\"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the difference between comp and comp-3 usage ? - Cobol","description":"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/","og_locale":"en_US","og_type":"article","og_title":"What is the difference between comp and comp-3 usage ? - Cobol","og_description":"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.","og_url":"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/","og_site_name":"Wikitechy","article_published_time":"2021-07-19T10:08:14+00:00","article_modified_time":"2021-09-09T06:27:29+00:00","author":"Editor","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Editor","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/","url":"https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/","name":"What is the difference between comp and comp-3 usage ? - Cobol","isPartOf":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website"},"datePublished":"2021-07-19T10:08:14+00:00","dateModified":"2021-09-09T06:27:29+00:00","author":{"@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757"},"description":"What is the difference between comp and comp-3 usage ? Explain other COBOL usage ? - COMP is 2 bytes.COMP is used for Binary Representation it allows only S and 9.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wikitechy.com\/interview-questions\/cobol\/what-is-the-difference-between-comp-and-comp-3-usage\/"]}]},{"@type":"WebSite","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#website","url":"https:\/\/www.wikitechy.com\/interview-questions\/","name":"Wikitechy","description":"Interview Questions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wikitechy.com\/interview-questions\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/4d5a581fb5470d1560324bddc5e8b757","name":"Editor","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.wikitechy.com\/interview-questions\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e9531079fe7e07841b7b156c04d65e5f39d4adfd18b6ffe3edfff8ca5aab85b5?s=96&d=mm&r=g","caption":"Editor"},"url":"https:\/\/www.wikitechy.com\/interview-questions\/author\/editor\/"}]}},"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/1033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/comments?post=1033"}],"version-history":[{"count":3,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/1033\/revisions"}],"predecessor-version":[{"id":3121,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/posts\/1033\/revisions\/3121"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/media?parent=1033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/categories?post=1033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/interview-questions\/wp-json\/wp\/v2\/tags?post=1033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}