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: 1277
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: 1277
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: 1277
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: 8666
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: 8318
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 Process file after 7 days of hold charlessxavier All Other Mainframe Topics 0 Tue May 22, 2018 3:54 pm
No new posts TRAILER3 is creating blank record in ... kodeesm DFSORT/ICETOOL 3 Fri May 18, 2018 5:45 pm
No new posts Transfer of mainframe file to PC in Z... maxsubrat JCL & VSAM 4 Thu May 17, 2018 11:35 am
No new posts Rexx command to open an another text ... Bharath Vikraman PC Guides & IT News 7 Sat May 12, 2018 4:34 pm
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am

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