have in 100 records in a file i want to read first 3 records
and skip next 3 records and agan i want to read 3 records and
again i want to skip 3 records...
Answers were Sorted based on User's Feedback
Answer / kairoon
In working storage declare
01 ws-count1 pic s9(4) comp value zeroes.
01 ws-count2 pic s9(4) comp value zeroes.
In procedure division
PERFORM 200000-PROCESS THRU 200000-EXIT
UNTIL WS-EOF-IN = 'Y'.
200000-PROCESS.
READ IN-FILE AT END MOVE 'Y' TO WS-EOF-IN
GO TO 200000-EXIT.
ADD 1 TO WS-COUNT1
IF WS-COUNT1 <= 3
MOVE IN-REC TO OUT-REC
WRITE OUT-REC
ELSE
ADD 1 TO WS-COUNT2
IF WS-COUNT2 = 3
MOVE ZEROES TO WS-COUNT1
WS-COUNT2
END-IF
END-IF.
200000-EXIT.
EXIT.
| Is This Answer Correct ? | 26 Yes | 3 No |
Answer / santhosh
We can do it through JCL by using sort utility ..Through splitby=3 in outfil statement giving two different outputs..It will store two alternative records into two datasets alternatively
| Is This Answer Correct ? | 0 Yes | 0 No |
How can you add a particular field/coloumn in copybook?
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 is the difference between structured cobol programming and object alternativelyiented cobol programming?
how do u list the abended jobs?
What are the two search techniques ?
Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1). can redefines clause be used with occurs clause?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Can anybody give me example of subscript and index
can we declare occurs in 01 level?
What does MAXCC 3 means? It is used in one my codes.
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
How to solve SOC7. I have the cobol coded as below 01 A PIC 9(4). 01 AIN REDEFINES A. 05 AIN1 PIC S9(4) 01 B PIC 9(4)V99. 01 BIN REDEFINES B. 05 BIN1 PIC S9(4)V99. PROCEDURE DIVISION. START-PARA. INITIALIZE A AIN B BIN. ACCEPT A B. DISPLAY 'VALUE OF A=' A. DISPLAY 'VALUE OF B=' B. DISPLAY 'VALUE OF BIN1=' BIN1. DISPLAY 'VALUE OF AIN1=' AIN1. COMPUTE AIN1 = BIN1 - AIN1. DISPLAY 'VALUE OF AIN1=' AIN1. When i'm executing this code i'm getting SOC7 for A = 12 & B=34. Can someone explain SDSF OUTPUT DISPLAY TCOM058R JOB05458 DSID 102 LINE 0 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> CSR ********************************* TOP OF DATA ********************************** VALUE OF A=12 VALUE OF B=34 VALUE OF BIN1=34 VALUE OF AIN1=12 CEE3207S The system detected a data exception (System Completion Code=0C7). From compile unit PROG1 at entry point PROG1 at statement 29 at compile +000004CE at address 00007ECE. Please address how to solve this issue Thanks in advance.