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

) how do u code after getting data?

2101


What is report-item in COBOL?

1117


Explain how to differentiate call by context by comparing it to other calls?

1150


Describe the cobol database components?

1135


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

1305


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2402


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1311


Why did you choose to work with ibm mainframe cobol programming?

1054


Write a program to explain size error.

1156


What are various search techniques in cobol? Explain.

1035


What are declaratives and what are their uses in cobol?

1154


How to remove 2 duplicate records and copy only one using job control language?

1183


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

1282


What guidelines should be followed to write a structured cobol prgm?

1112


How do you differentiate between cobol and cobol-ii?

1151