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

How to know whether the module is dynamical or statistical?

660


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

737


What is the Purpose of Pointer in the string?

645


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1121


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

714






What is the problem of ordered sequential files access?

706


) what is the difference between AID and HANDLE AID?

1639


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

650


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

2223


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

809


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1703


How do you reference the fixed block file formats from cobol programs

711


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.

2064


Which mode is used to operate the sequential file?

673


What is an in line perform? When would you use it? Anything else you wish to say about it.

649