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 a front spaces in a data-name/variable in
cobol
Example:-
01 data-name-1 PIC x(20) value " cobol language".
01 data-name-2 PIC x(20).
MOVE data-name-1 to data-name-2.
would like the value of data-name-2 is "cobol language".

Answer Posted / varun v

we can use "Inspect Tallying" also for the same. I guess
this one is more effective.

Working storage Variable:
01 data-name-1 PIC x(20) value " cobol language".
01 data-name-2 PIC x(20).
01 WS-TALLY1 PIC 9(02) VALUE ZERO.

Procedure Dvision:
Inspect data-name-1 Tallying WS-TALLY1 for leading
spaces
Move data-name-1(WS-TALLY1+1 : 20-WS-TALLY1) to
data-name-2.

Now data-name-2 should have
Value 'cobol language'.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

9036


how to move the records from file to array table. give with code example

2644


What is the difference between goback, stop run and exit program in cobol?

1543


What is a SSRANGE and NOSSRANGE?

1425


Name the sections present in data division.

1186


Why occurs cannot be used in 01 level in COBOL?

1133


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

1104


What are literals?

1081


What is perform what is varying?

1120


How do we get current date from system with century in COBOL?

1338


What is a scope terminator give example?

1070


Name the divisions, which are available in a cobol program?

1188


State the various causes of s0c1, s0c5 and s0c7.

1033


HOw can I get the negative sign while deduct high value from low value

2222


how do you reference the fixed unblock file formats from cobol programs

1185