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
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
how do you reference the rrds file formats from cobol programs
What is the difference between comp and comp-3 usage?
What is the difference between PIC 9.99 and 9v99 in COBOL?
What is the LINKAGE SECTION used in COBOL?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Why did you choose to work with ibm mainframe cobol programming?
What is the difference between structured cobol programming and object alternativelyiented cobol?
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.
What are the pertinent COBOL commands?
how to access the file from prodution from changeman tool and to submit a file to production
What type of SDLC u followed? Why?
How to remove 2 duplicate records and copy only one using job control language?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What is the difference between next sentence and continue in cobol programing language?