here is my requirement
A1 is alphanumeric with value 'A1B2C3D4' as defined below
05 A1 PIC X(8) VALUE IS 'A1B2C3D4'
but i need to have A2,A3 as ABCD & 1234 repectively......
A2 = ABCD
A3 = 1234
Can you please explain me what are the different ways to do it?
Answer Posted / rajkanya
DATA DIVISION.
WORKING-STORAGE SECTION.
01 GROUP1.
05 A1 PIC X(08)
VALUE 'A1B2C3D4'.
05 ARRAY1 REDEFINES A1 OCCURS 8 TIMES
PIC X(01).
01 ARRAY2.
05 A2 OCCURS 4 TIMES PIC X(01).
01 ARRAY3.
05 A3 OCCURS 4 TIMES PIC X(01).
01 WS-COUNT PIC 9(02)
VALUE 01.
PROCEDURE DIVISION.
PERFORM MOVE-LETTERS-PARA VARYING ODD FROM 1 BY 2
UNTIL ODD > 8
* INITIALIZE THE COUNTER FOR SECOND LOOP
MOVE 01 TO WS-COUNT
*
PERFORM MOVE-NUMBERS-PARA VARYING EVEN FROM 2 BY 2
UNTIL EVEN > 8
.
.
.
MOVE-LETTERS-PARA.
MOVE ARRAY (ODD) TO ARRAY2 (WS-COUNT)
ADD 1 TO WS-COUNT
.
.
MOVE-NUMBERS-PARA.
MOVE ARRAY (EVEN) TO ARRAY3 (WS-COUNT)
ADD 1 TO WS-COUNT
.
.
.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Which is not true about evaluate statement
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
how do you reference the variable block file formats from cobol programs
Discuss about changing dataset name in proc.
What is the problem of ordered sequential files access?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
How do you differentiate between cobol and cobol-ii?
Which division and paragraphs are mandatory for a COBOL program?
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
How do you get the data to code the BMS macro?
what are decleratives in cobol?
Can you please let me know the centre name of INS certification in Kolkata.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is a SSRANGE and NOSSRANGE?
How do get the result of your program directly on your pc?