Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to delete leading spaces/blank in COBOL ?
Example:- 01 data-name-1 pic x(220) " English is a
language".
I would like to delete leading spaces.

Answer Posted / prasanth

Wroking storage Variable:
01 WS-VAR PIC X(15) VALUE ' COBOL'.
01 WS-VAR-FINAL PIC X(15).
01 WS-TALLY1 PIC 9(02) VALUE ZERO.

Procedure division


INITIALIZE WS-TALLY

MOVE ID-TBL-IMMS OF TBL TO WS-USERID-TEMP

INSPECT WS-USERID-TEMP TALLYING WS-TALLY
FOR LEADING SPACE

MOVE WS-TALLY TO WS-TEMP
IF WS-TALLY IS NOT ZERO

MOVE WS-USERID-TEMP(WS-TALLY + 1 : ) TO WS-LS-USERID

Is This Answer Correct ?    6 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between external and global variables in COBOL?

1355


What rules are followed by the search verb.

1045


What is static and dynamic call in cobol?

1000


What are different data types in cobol?

1227


What are the various section in data division and briefly explain them.

1109


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2530


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1063


How do get the result of your program directly on your pc?

2294


When is inspect verb is used in cobol?

1179


i want a program using by if, evaluate , string, unstring, perform, occurs?

4634


How to print 10 to 1 if the input have only 10 digit number?

1215


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

1142


How do you get the data to code the BMS macro?

1919


Difference between cobol and cobol-ii?

1193


what is amode(24), amode(31), rmode(24) and rmode(any)?

1092