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

What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1300


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.

2435


What is a scope terminator give example?

1113


What is the difference between PIC 9.99 and 9v99 in COBOL?

1334


Give some examples of command terminators?

1261


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1152


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2965


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

1083


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

1221


Difference between array and sub-script ?

1666


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

4173


How many bytes S(8) comp field occupy and its maximum value?

2144


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

2348


what is search and searchall?what is the diffrence between them?give an best example?

6832


Explain the configuration section of a cobol program with examples of syntax.

1200