Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum 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: 11
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: 1349
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: 1349
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: 11
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: 1349
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: 11
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: 11
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: 8796
Location: Welsh Wales

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: 8553
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 Multiple Sums in one File Rick Ryan SYNCSORT 2 Wed Jul 29, 2020 1:30 am
No new posts Extract part of data from file and wr... sathyajes DFSORT/ICETOOL 9 Thu Jul 16, 2020 10:49 am
No new posts Identify the count from two diffrent ... UmashankarSubramani DFSORT/ICETOOL 19 Sat Jul 11, 2020 4:35 am
No new posts CICS file processing using applicatio... Satish_gsv CICS 3 Sat Jul 11, 2020 4:18 am
No new posts Problem getting record length of a re... amitc23 COBOL Programming 2 Thu Jul 02, 2020 10:52 pm

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