View previous topic :: View next topic
|
Author |
Message |
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Hi,
I'm running a cobol-sort prog using IGYWCLG. I'm getting correct result.. but only last record is repeating in output file. and also getting S000 U4038 abend code. Please help me to solve this.
thanks in advance |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
I had 40 recs in input file... it's writing 41 recs in output file...
The message i'm getting in CEEDUMP is-- "SORT2 was not compiled with the SYM suboption of the TEST option. A formatted variable dump cannot be produced".
and in sysout is-- "The flow of control in program SORT2 proceeded beyond the last line of the program. From compile unit SORT2 at entry point SORT2 at compile unit offset +000008BE at address 00006DFE. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
look at the jcl log to see the original abend,
U4038 is a generic abend which comes at the end of LE abend processing
if You need more help post the relevant lined form the log |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You may be getting the last record twice due to some processing after end of file. This might also cause the abend. |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
dick,
You are right dick,same thing happening here... Still I'm trying.. |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi Vinay,
May be the Loop is not correct, if you send code, we can help you
Quote: |
I had 40 recs in input file... it's writing 41 recs in output file... |
Any how use following logic
Code: |
PROCEDURE DIVISION
0000-MAIN.
.
.
OPEN INPUT INPUT-FILE
OUTPUT OUT-FILE
READ INPUT-FILE
PERFORM PARA-1 UNTIL EOF
STOP RUN
PARA-1
WRITE OUT-REC FROM INPUT-REC
READ INPUT-FILE AT END SET EOF TO TRUE |
|
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Code: |
PROCEDURE DIVISION USING LS-FIELD.
ACCEPT LS-FIELD.
PERFORM A00-OPEN-FILES.
IF LS-FIELD = 'A'
DISPLAY 'ASCENDING ORDER SELECTED'
SORT SYS-FILE ON ASCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
IF LS-FIELD = 'D'
DISPLAY 'DESCENDING ORDER SELECTED'
SORT SYS-FILE ON DESCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
PERFORM C00-CLOSE-FILES.
STOP RUN.
A00-OPEN-FILES.
OPEN INPUT IN-FILE.
OPEN OUTPUT OUT-FILE.
A10-INPUT-PROCEDURE.
PERFORM UNTIL WS-FLAG = 'Y'
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
RELEASE SYS-REC
END-PERFORM.
B10-OUTPUT-PROCEDURE.
RETURN SYS-FILE
AT END GO TO C00-CLOSE-FILES.
MOVE SYS-REC TO OUT-REC.
WRITE OUT-REC.
GO TO B10-OUTPUT-PROCEDURE.
C00-CLOSE-FILES.
CLOSE IN-FILE, OUT-FILE.
|
And this my comp,run jcl....
[/code]
//CKP1SA JOB '283597','VINAY',NOTIFY=&SYSUID,
// MSGCLASS=Y,PRTY=15
//STEP1 EXEC IGYWCLG,PARM.COBOL='FASTSRT'
//COBOL.SYSIN DD DSN=E1682.VINAY.COBOL(SORT2),DISP=SHR
//LKED.SYSLMOD DD DSN=E1682.VINAY.LOADLIB(SORT2),DISP=SHR
//LKED.SYSLIB DD DSN=CEE.SCEELKED,DISP=SHR
//GO.INP DD DSN=E1682.VINAY.INP,DISP=SHR
//GO.OUTP DD DSN=E1682.VINAY.OUTP,DISP=SHR
//GO.SYST DD DSN=&TEMP,DISP=(,PASS),SPACE=(TRK,(10,10),RLSE)
//GO.SYSIN DD *
A |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Vinay,
Code: |
PROCEDURE DIVISION USING LS-FIELD.
ACCEPT LS-FIELD.
PERFORM A00-OPEN-FILES.
IF LS-FIELD = 'A'
DISPLAY 'ASCENDING ORDER SELECTED'
SORT SYS-FILE ON ASCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
IF LS-FIELD = 'D'
DISPLAY 'DESCENDING ORDER SELECTED'
SORT SYS-FILE ON DESCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
PERFORM C00-CLOSE-FILES.
STOP RUN.
A00-OPEN-FILES.
OPEN INPUT IN-FILE.
OPEN OUTPUT OUT-FILE.
A10-INPUT-PROCEDURE.
PERFORM UNTIL WS-FLAG = 'Y'
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
RELEASE SYS-REC
END-PERFORM.
B10-OUTPUT-PROCEDURE.
RETURN SYS-FILE
AT END GO TO C00-CLOSE-FILES.
MOVE SYS-REC TO OUT-REC.
WRITE OUT-REC.
GO TO B10-OUTPUT-PROCEDURE.
C00-CLOSE-FILES.
CLOSE IN-FILE, OUT-FILE. |
Chnage program like this
Vinay,
Code: |
PROCEDURE DIVISION USING LS-FIELD.
ACCEPT LS-FIELD.
PERFORM A00-OPEN-FILES.
IF LS-FIELD = 'A'
DISPLAY 'ASCENDING ORDER SELECTED'
SORT SYS-FILE ON ASCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
IF LS-FIELD = 'D'
DISPLAY 'DESCENDING ORDER SELECTED'
SORT SYS-FILE ON DESCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
PERFORM C00-CLOSE-FILES.
STOP RUN.
A00-OPEN-FILES.
OPEN INPUT IN-FILE.
OPEN OUTPUT OUT-FILE.
A10-INPUT-PROCEDURE.
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
PERFORM UNTIL WS-FLAG = 'Y'
RELEASE SYS-REC
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
END-PERFORM. |
--------------------------------------------------------------
This is why the record get repeated in output file
------------------------------------------------------------
Code: |
B10-OUTPUT-PROCEDURE.
RETURN SYS-FILE
AT END GO TO C00-CLOSE-FILES.
MOVE SYS-REC TO OUT-REC.
WRITE OUT-REC.
GO TO B10-OUTPUT-PROCEDURE.
C00-CLOSE-FILES.
CLOSE IN-FILE, OUT-FILE. |
Why you are giving, its not necessary remove this code
Execute and let me know the result |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Raghu,
SYS-REC is temp file used for sorting. I need to write recs in out-file. So why i'm using B10-PARA. And i tried with your code also but i'm getting same abend. |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hello Vinay,
Quote: |
SYS-REC is temp file used for sorting. I need to write recs in out-file. So why i'm using B10-PARA |
The code which you gave is a type of ADVANCED SORT,
What you doing there is
1) You are reading sequentially from INPUT-FILE then writing into the SORT-FILE using RELEASE command
2) Then you are reading record from SORT-FILE then writing into OUTPUT-FILE
( B10-PARA will do this)
Change program as i suggest below
-------------------------------------------------------------
Code: |
PROCEDURE DIVISION USING LS-FIELD.
ACCEPT LS-FIELD.
PERFORM A00-OPEN-FILES.
IF LS-FIELD = 'A'
DISPLAY 'ASCENDING ORDER SELECTED'
SORT SYS-FILE ON ASCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
IF LS-FIELD = 'D'
DISPLAY 'DESCENDING ORDER SELECTED'
SORT SYS-FILE ON DESCENDING KEY S-TELNO
INPUT PROCEDURE IS A10-INPUT-PROCEDURE
OUTPUT PROCEDURE IS B10-OUTPUT-PROCEDURE
END-IF.
STOP RUN.
A00-OPEN-FILES.
OPEN INPUT IN-FILE.
OPEN OUTPUT OUT-FILE.
A10-INPUT-PROCEDURE.
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
PERFORM UNTIL WS-FLAG = 'Y'
RELEASE SYS-REC
READ IN-FILE AT END MOVE 'Y' TO WS-FLAG
NOT AT END MOVE IN-REC TO SYS-REC
END-READ
END-PERFORM.
B10-OUTPUT-PROCEDURE.
RETURN SYS-FILE
AT END GO TO C00-CLOSE-FILES.
MOVE SYS-REC TO OUT-REC.
WRITE OUT-REC.
GO TO B10-OUTPUT-PROCEDURE.
C00-CLOSE-FILES.
CLOSE IN-FILE, OUT-FILE. |
Execute and let me know the result |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Raghu,
I used the code sent by you. Now I'm getting correct result i.e last rec is not repeating but still i'm getting abend. |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi Vinay,
Did you removed
Code: |
PERFORM C00-CLOSE-FILES. |
from before STOP RUN
Go through manual first, really it will help you
Execute once again and let me know result, if it still throw error send me JCL |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi vinay,
Quote: |
I used the code sent by you. Now I'm getting correct result i.e last rec is not repeating but still i'm getting abend. |
What did u mean, You are getting result correctly but it still get abended |
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Ya i removed that also. Now i'm sending my JCL also... i think it's already in this topic....
Code: |
//CKP1SA JOB '283597','VINAY',NOTIFY=&SYSUID,
// MSGCLASS=Y,PRTY=15
//STEP1 EXEC IGYWCLG,PARM.COBOL='FASTSRT'
//COBOL.SYSIN DD DSN=E1682.VINAY.PDS(SORT2),DISP=SHR
//LKED.SYSLMOD DD DSN=E1682.VINAY.LOADLIB(SORT2),DISP=SHR
//GO.INP DD DSN=E1682.VINAY.INP,DISP=SHR
//GO.OUTP DD DSN=E1682.VINAY.OUTP,DISP=SHR
//GO.SYST DD DSN=&TEMP,DISP=(,PASS),SPACE=(TRK,(10,10),RLSE)
//GO.SYSIN DD *
A
|
|
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Quote: |
What did u mean, You are getting result correctly but it still get abended
I mean I'm getting correct no of recs in output file in correct sorted order.. But still job ending with S000 U4038 abend... and in sysout i'm getting msg as...
Code: |
The flow of control in program SORT2 proceeded beyond the last line of the program. From compile unit SORT2 at entry point SORT2 at compile unit offset +00000890 at address 00006E00.
END OF DFSORT
|
|
|
|
Back to top |
|
|
VinayCM
New User
Joined: 06 Nov 2007 Posts: 36 Location: Bengaluru
|
|
|
|
Anybody got any idea(solution) for my probs....... |
|
Back to top |
|
|
|