|
View previous topic :: View next topic
|
| Author |
Message |
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
Hi,
I need help on processing of SORTIN file in COB2 module. SORTIN and SORTOUT files are defined at linkage section. I can see in the code FIRST-RECORD,OTHER-RECORD and END-RECORD are defined.
I am not clear how each record is getting read? and how FIRST-RECORD,OTHER-RECORD and END-RECORD are set ? |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
I think your program is a Sort Exit, maybe E15
The program gets control with each record from the SORTIN, and returns a Return Code that tells Sort to accept the record, delete it or modify it.
There are other options (insert a new record, end the sort...)
You should check you SYNCSORT/DFSORT documentation. |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
| FIRST-RECORD, OTHER-RECORD and END-RECORD are set by the sort program and allow you to do extra processing, like opening (at FIRST) and closing (at LAST) a secondary file. |
|
| Back to top |
|
 |
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
| When I am executing the program it goes directly to END-RECORD. What could be the cause? |
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
Did you execute your sort program ?
| Code: |
//STEP01 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=hlq.input
//SORTOUT DD DISP=SHR,DSN=hlq.output
//SYSIN DD *
SORT FIELDS=COPY
MODS E15=(YourProgramName,EstimatedPgmSize,,C)
//* |
What I would do before running the program:
1. Search all JCL libraries for a job having "YourProgramName" in it.
2. Check the source code to see if there is any information about the input dataset (in working-storage and linkage, in copybooks and in comments for example). |
|
| Back to top |
|
 |
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
Hi Marso,
Thank you , with E15 it worked but it was E35 before. Why it did not worked with E35?
My JCL was like this.
//SORTIN DD DSN=XXX.YYY,DISP=OLD
//SORTOUT DD DSN=AAA.YYY,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COBEXIT=COB2
INCLUDE COND=(35,2,CH,EQ,C'01',OR,35,2,CH,EQ,C'03'),FORMAT=CH
SORT FIELDS=(1,6,CH,A,19,16,CH,A,7,12,CH,A,35,5,CH,A,
46,4,CH,D,43,2,CH,D)
RECORD TYPE=F,LENGTH=(206,,270)
MODS E35=(module_name,200000,,C) |
|
| Back to top |
|
 |
rizwanaccy
New User
Joined: 02 Jan 2018 Posts: 11 Location: INDIA
|
|
|
|
Hi,
It still did not work with E15, for first record , sort-flag is 0 , for second record sort-flag is 4 , from 3rd record onwards sort-flag value is 655360. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| How about showing some useful output from your job ? |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Do you understand the difference between an E15 and an E35 exit? If not, you need to read the manuals more. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|