Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

www.topictrick.com

COBOL

STRING HANDLING

Common Business Oriented Language

COBOL String Handling.

String manipulation is an integral part of any programming language. Most of the time, you have a requirement to concatenate, split, or extract characters from the string.

In COBOL, you have various functions that can be used to manipulate string as per need. Let's look at STRING statement.

Introduction

STRING Statement - Concatenation two or more fields .

Example.

COBOL STRING Statement.

In COBOL, STRING statement is used to combine data from two or more variable/literal into a destination variable or fields.

String Statement

Rule: In COBOL string, data movement is from left to right.

You should carefully select destination field length to avoid overflow.

COBOL String Statement Syntax.

String Syntax

STRING Clause Rules.

STRING Rules

  • Delimited By clause determines what part of a sending field is sent to the receiving field.

  • Destination field should be initialized before sending any data because it would retain old value if source string length is less.

  • The ON OVERFLOW clause executes if valid characters remain to be transferred in the source string but the destination string is full.

  • The POINTER option can be used to count the number of characters actually moved into a receiving field

String Example

Thank you!

<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In -->

<svg version="1.1"

xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"

x="0px" y="0px" width="774px" height="115.4px" viewBox="0 0 774 115.4" style="enable-background:new 0 0 774 115.4;"

xml:space="preserve">

<style type="text/css">

.st0{fill:#FFFFFF;}

.st1{fill:url(#SVGID_1_);stroke:#047391;stroke-width:0.3288;stroke-linecap:round;}

.st2{fill:#F4C327;stroke:#006B33;stroke-width:1.3154;stroke-dasharray:1.9731,0.8221;}

.st3{fill:none;stroke:#0060B6;stroke-width:0.6577;stroke-linecap:round;}

.st4{fill:#FF7F00;stroke:#BF0000;stroke-width:0.1644;}

.st5{fill:#60F475;stroke:#BF0000;stroke-width:0.1415;}

.st6{fill:none;stroke:#006B33;stroke-width:0.283;stroke-linecap:round;}

.st7{fill:#FF4000;}

.st8{opacity:0.23;fill:url(#SVGID_2_);enable-background:new ;}

.st9{fill:url(#SVGID_3_);stroke:#047391;stroke-width:0.3191;stroke-linecap:round;}

.st10{opacity:0.43;fill:url(#SVGID_4_);stroke:#006B33;stroke-width:1.8524;stroke-dasharray:1.1578,3.4733;enable-background:new ;}

.st11{fill:none;stroke:#003CFF;stroke-width:0.4787;stroke-linecap:round;}

.st12{fill:#FF7F00;stroke:#BF0000;stroke-width:0.1596;}

.st13{opacity:0.62;}

.st14{fill:#60F475;stroke:#BF0000;stroke-width:0.1373;}

.st15{fill:none;stroke:#006B33;stroke-width:0.2747;stroke-linecap:round;}

.st16{opacity:0.62;fill:#60F475;stroke:#BF0000;stroke-width:0.1373;enable-background:new ;}

.st17{fill:url(#SVGID_5_);stroke:#047391;stroke-width:0.3914;stroke-linecap:round;}

.st18{opacity:0.17;fill:url(#SVGID_6_);enable-background:new ;}

.st19{fill:none;stroke:#003CFF;stroke-width:0.5872;stroke-linecap:round;}

.st20{fill:#FF7F00;stroke:#BF0000;stroke-width:0.1957;}

.st21{fill:#60F475;stroke:#BF0000;stroke-width:0.1684;}

.st22{fill:none;stroke:#006B33;stroke-width:0.3369;stroke-linecap:round;}

.st23{opacity:0.62;fill:#60F475;stroke:#BF0000;stroke-width:0.1684;enable-background:new ;}

.st24{fill:url(#SVGID_7_);stroke:#047391;stroke-width:0.4998;stroke-linecap:round;}

.st25{fill:#FF7F00;stroke:#BF0000;stroke-width:0.2499;}

.st26{fill:#60F475;stroke:#BF0000;stroke-width:0.2151;}

.st27{fill:none;stroke:#006B33;stroke-width:0.4302;stroke-linecap:round;}

.st28{opacity:0.62;fill:#60F475;stroke:#BF0000;stroke-width:0.2151;enable-background:new ;}

.st29{fill:#F4C327;stroke:#006B33;stroke-width:1.8736;}

.st30{fill:#FF7F00;}

.st31{fill:url(#SVGID_8_);stroke:#047391;stroke-width:0.3873;stroke-linecap:round;}

.st32{opacity:0.17;fill:url(#SVGID_9_);enable-background:new ;}

.st33{fill:none;stroke:#003CFF;stroke-width:0.4777;stroke-linecap:round;}

.st34{fill:#FF7F00;stroke:#BF0000;stroke-width:0.1936;}

.st35{fill:#60F475;stroke:#BF0000;stroke-width:0.1666;}

.st36{fill:none;stroke:#006B33;stroke-width:0.3333;stroke-linecap:round;}

.st37{opacity:0.62;fill:#60F475;stroke:#BF0000;stroke-width:0.1666;enable-background:ne

Learn more about creating dynamic, engaging presentations with Prezi