{"id":12481,"date":"2018-04-12T04:20:33","date_gmt":"2018-04-12T09:20:33","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=12481"},"modified":"2025-06-10T05:56:41","modified_gmt":"2025-06-10T05:56:41","slug":"how-to-extract-a-substring-from-a-string-in-sage-x3","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2018\/04\/12\/how-to-extract-a-substring-from-a-string-in-sage-x3\/","title":{"rendered":"How to extract a Substring from a String in Sage X3"},"content":{"rendered":"<p>While dealing with strings, we often require certain characters or a substring from given string. Sage X3 provides a special function to extract a substring from provided CLOB or a string.<\/p>\n<p><strong><u>Syntax<\/u><\/strong><strong>:<\/strong><strong>\u00a0<\/strong><\/p>\n<p><strong>mid$(EXP_STRING,EXP_POS,EXP_NB)<\/strong><\/p>\n<p><em>Where,<\/em><em>\u00a0<\/em><\/p>\n<ul>\n<li>EXP_STRING is an expression returning a CLOB or string value.<\/li>\n<li>EXP_POS is an expression returning an integer value that is the position of the first character to be extracted.<\/li>\n<li>EXP_NB is an expression returning an integer value that defines the number of characters to be extracted.<em>\u00a0<\/em><\/li>\n<\/ul>\n<p><strong><u>Example<\/u><\/strong><strong>:<\/strong><\/p>\n<p>In below example, 3 characters from 4<sup>th<\/sup> position of a string \u201cWelcome!\u201d are extracted.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-12483 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/04\/substring-from-string.png\" alt=\"substring from string\" width=\"296\" height=\"77\" \/><\/p>\n<p><strong><u>Output<\/u><\/strong><strong>:<\/strong><strong>\u00a0<\/strong><\/p>\n<p>It gives substring \u201ccom\u201d as an output.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-full wp-image-12484 aligncenter\" src=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-content\/uploads\/2018\/04\/extract-substring-from-string.png\" alt=\"extract substring from string\" width=\"383\" height=\"141\" \/><\/p>\n<p><strong>Hope this helps!<\/strong><\/p>\n<p><strong>About Us<\/strong><\/p>\n<p><a href=\"http:\/\/www.greytrix.com\/\">Greytrix<\/a> is a one-stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.<\/p>\n<p><a href=\"http:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0has some unique solutions of\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\">Sage X3 integration with Sage CRM<\/a>,\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Salesforce.com<\/a>,\u00a0and\u00a0<a href=\"http:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\">Magento eCommerce<\/a> along with Sage X3 migration from Sage 50 US, Sage Pro, and QuickBooks. \u00a0We also offer best-in-class <a href=\"http:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\">Sage X3 customization and development services<\/a> to Sage business partners, end users, and Sage PSG worldwide.<\/p>\n<p>For more information on Sage X3 Integration and Services, please contact us at\u00a0<a href=\"mailto:x3@greytrix.com\">x3@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While dealing with strings, we often require certain characters or a substring from given string. Sage X3 provides a special function to extract a substring from provided CLOB or a string. Syntax:\u00a0 mid$(EXP_STRING,EXP_POS,EXP_NB) Where,\u00a0 EXP_STRING is an expression returning a CLOB or string value. EXP_POS is an expression returning an integer value that is the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2018\/04\/12\/how-to-extract-a-substring-from-a-string-in-sage-x3\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[1281,1282,1941,1942,1945,2191,2205,2206],"class_list":["post-12481","post","type-post","status-publish","format-standard","hentry","category-faq","tag-mid-string","tag-mid","tag-sage-x3-technical","tag-sage-x3-technical-assistance","tag-sage-x3-technical-blogs","tag-string","tag-substring","tag-substring-from-string"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/12481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=12481"}],"version-history":[{"count":2,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/12481\/revisions"}],"predecessor-version":[{"id":30945,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/12481\/revisions\/30945"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=12481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=12481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=12481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}