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".
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / deepak dada
01 data-name-1 pic value " cobol language" justified
right.
01 data-nane-2 pic(20).
01 data-name-3 redifines data-name-2 pic x(14).
move data-name-1 to data-name-3.
display data-name-3.
Is This Answer Correct ? | 1 Yes | 2 No |
Study the DATA DIVISION entries and the three PROCEDURE DIVISION entries given below: 01 END-OF-FILE-SWITCH PIC XXX. 88 NO-MORE-RECS VALUE "YES". 88 MORE-RECS VALUE "NO". (i) READ SAMPLE-FILE AT END MOVE "YES" TO NO-MORE-RECS. (ii) IF NO-MORE-RECS = "YES" GO TO LAST-PARA. (iii) IF NO-MORE-RECS GO TO LAST-PARA. Which are wrong? (a) (i) and (ii) (b) (ii) and (iii) (c) (i) and (iii) (d) all
how do you reference the variable block file formats from cobol programs
SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.
What is the use of EVALUATE statement?
Can anyone please give the example of Inline Perform.
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
Define static linking and dynamic linking.
How do u debug a S0C7 abend? (aswered till we get the field which caused that) After knowing the field which caused that how do u know the record which caused that if it is in production env? (dumb) Ok let us assume that we got to know that 100th record caused that and I wanted to skip only 100th record from the file and process from 101th. How to do that in JCL using SORT? (tried with STOPAFT but ended up dumb when he said smthing else is ther)
77 I pic 99 value 5 Perorm para-A I times. Para -A. move 10 to I. How many times the para-A will be executed.?
How is sign stored in Packed Decimal fields and Zoned Decimal fields?
how can u pass the values into db2 values from cobol ?
What is sqlca and why is it needed in any cobol-db2 program?