Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COB2 file processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
rizwanaccy

New User


Joined: 02 Jan 2018
Posts: 5
Location: INDIA

PostPosted: Tue Jan 02, 2018 1:00 pm    Post subject: COB2 file processing
Reply with quote

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
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1284
Location: Israel

PostPosted: Tue Jan 02, 2018 3:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1284
Location: Israel

PostPosted: Tue Jan 02, 2018 4:16 pm    Post subject:
Reply with quote

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
View user's profile Send private message
rizwanaccy

New User


Joined: 02 Jan 2018
Posts: 5
Location: INDIA

PostPosted: Tue Jan 02, 2018 6:56 pm    Post subject:
Reply with quote

When I am executing the program it goes directly to END-RECORD. What could be the cause?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1284
Location: Israel

PostPosted: Tue Jan 02, 2018 8:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
rizwanaccy

New User


Joined: 02 Jan 2018
Posts: 5
Location: INDIA

PostPosted: Wed Jan 03, 2018 5:39 pm    Post subject:
Reply with quote

Hi Marso,

Thank you icon_biggrin.gif , 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
View user's profile Send private message
rizwanaccy

New User


Joined: 02 Jan 2018
Posts: 5
Location: INDIA

PostPosted: Wed Jan 03, 2018 6:51 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Wed Jan 03, 2018 7:10 pm    Post subject:
Reply with quote

How about showing some useful output from your job ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8355
Location: Dubuque, Iowa, USA

PostPosted: Wed Jan 03, 2018 7:26 pm    Post subject:
Reply with quote

Do you understand the difference between an E15 and an E35 exit? If not, you need to read the manuals more.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts KSDS file fields update by passing va... Anil Kumar Prajapati TSO/ISPF 5 Wed Jul 11, 2018 5:59 am
No new posts Comparing inside same file vickey_dw DFSORT/ICETOOL 2 Tue Jul 10, 2018 9:51 pm
No new posts LIST NODE DIRECTORY - db2 clp - tryin... elixir1986 IBM Tools 1 Sat Jul 07, 2018 6:15 pm
No new posts INCLUDE 2 conditions to copy in the o... Chiku kumar DFSORT/ICETOOL 10 Tue Jul 03, 2018 7:11 pm
No new posts FILE versus DATASET jerryte All Other Mainframe Topics 9 Fri Jun 29, 2018 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us