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
How to know whether the module is dynamical or statistical?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What is the Purpose of Pointer in the string?
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.
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
What is the problem of ordered sequential files access?
) what is the difference between AID and HANDLE AID?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
how to move the records from file to array table. give with code example
How do we get current date from system with century in COBOL?
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.
How do you reference the fixed block file formats from cobol programs
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.
Which mode is used to operate the sequential file?
What is an in line perform? When would you use it? Anything else you wish to say about it.