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 / varun v

Yes, we can use "Inspect Tallying" for the same.

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 Dvision:
Inspect WS-VAR Tallying WS-TALLY1 for leading spaces
Move WS-VAR(WS-TALLY1+1 : 15-WS-TALLY1) to
WS-VAR-FINAL.

Now WS-INSPECT-FINAL should have
Value 'COBOL'.

Is This Answer Correct ?    50 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How are the next sentence and continue different from each other?

1304


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

1262


Describe the cobol database components?

1185


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

1366


Have you used comp and comp-3 in your project? And how?

2488


State the various causes of s0c1, s0c5 and s0c7.

1095


What are various search techniques in cobol? Explain.

1079


What is the problem of ordered sequential files access?

1172


What is report-item in COBOL?

1166


Which mode is used to operate the sequential file?

1213


how do you reference the printer file formats from cobol programs

1230


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

9112


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

1155


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

1161


Write a cobol program making use of the redefine clause.

1191