Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Compare trailer count with detail record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 9:53 am    Post subject: Compare trailer count with detail record
Reply with quote

Hello Experts,

I need help to compare the trailer record count with detail record count in the file using dfsort.

Logical record length of file is 80.
trailer count length is PIC 9(06).

here is the file structure:

H20120307 1148 00001
3xxxxxxxxxxxxxxN11290125 9056821822 RVNDIVR CR
3xxxxxxxxxxxxxxV11290123 6032823827 M1VDIVR CR
3xxxxxxxxxxxxxxI11290134 6168888638 O1IDIVR CR
3xxxxxxxxxxxxxxM11290138 6168888638 O1MDIVR CR
3xxxxxxxxxxxxxxL11290134 6917268638 WVLDIVR CR
3xxxxxxxxxxxxxxN11290125 9056821822 RVNDIVR CR
T000006

RC = 0 FOR COUNT MATCH
RC=16 FOR UNMATCH COUNT.

Thanks
Sudip
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Mar 08, 2012 10:54 am    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC  PGM=SORT                                             
//SORTIN   DD *                                                       
H20120307 1148 00001                                                   
3XXXXXXXXXXXXXXV11290123 6032823827 M1VDIVR CR                         
3XXXXXXXXXXXXXXI11290134 6168888638 O1IDIVR CR                         
3XXXXXXXXXXXXXXM11290138 6168888638 O1MDIVR CR                         
3XXXXXXXXXXXXXXL11290134 6917268638 WVLDIVR CR                         
3XXXXXXXXXXXXXXN11290125 9056821822 RVNDIVR CR                         
3XXXXXXXXXXXXXXN11290125 9056821822 RVNDIVR CR                         
T000006                                                               
//SORTOUT  DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  DEBUG NOABEND                                                       
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD)),                   
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),                                 
                OVERLAY=(81:81,6,ZD,SUB,+2,EDIT=(TTTTTT)))             
  OUTFIL INCLUDE=(1,1,CH,EQ,C'T',AND,2,6,ZD,EQ,81,6,ZD),               
  NULLOFL=RC16                                                         
/*                                                                     



Gerry
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 11:09 am    Post subject: Re:Compare trailer count with detail record
Reply with quote

Hi Gerry

Thanks for your response.I have tried sortcard given above however i am getting below error in the sysout:
WER061A I/O ERR NXXXXX,JS010 ,JES ,O,SORTOUT ,WRITE ,WRITE ERROR ,****,**************,BSAM

Thanks
Sudip
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 11:21 am    Post subject:
Reply with quote

Hi Gerry

Please ignore my previous post.There was some syntax error in sysout.

I have tested my sortcard and here is the result:

correct count:
getting Maxcc 0
incorrect count
Getting Maxcc 0

Looks like there is some problem with unmatch count compare.

Thanks
Sudip
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Mar 08, 2012 12:14 pm    Post subject:
Reply with quote

Hi,

can you provide your JCL and data used including the control cards.


Gerry
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 12:17 pm    Post subject:
Reply with quote

Here is the JCL:
input data is the same i have posted above.

//JS010 EXEC PGM=SORT,
// REGION=0M
//*
//SORTIN DD DSN=file name,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DEBUG NOABEND
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
OVERLAY=(81:81,6,ZD,SUB,+2,EDIT=(TTTTTT)))
OUTFIL INCLUDE=(1,1,CH,EQ,C'T',AND,2,6,ZD,EQ,81,6,ZD),
NULLOFL=RC16
/*

Regards
Sudip
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Mar 08, 2012 12:40 pm    Post subject: Reply to: Compare trailer count with detail record
Reply with quote

You have no reason to complain...
You posted in the DFSORT/ICETOOL section of the forum, and misled everybody by telling
Quote:
... using dfsort


but You are using SYNCSORT ( as proved by the WER messages )
if You had told so from the beginning somebody would have posted a SYNCSORT solution
and would have not wasted any time
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 12:45 pm    Post subject:
Reply with quote

Hi Enrico

my apologize for posting in wrong section and misleading all experts:
yes i am using synsort:

Regards,
sudip
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Mar 08, 2012 1:12 pm    Post subject: Reply to: Compare trailer count with detail record
Reply with quote

we keep telling everyone who ask <SORT> questions that is is important to tell
what sort product he/she is using and the level of it
so that people who answer know what features/facilities are available

the simple way is ( both for DFSORT and SYNCSORT ) to run a job like ...

Code:
//SHOW    EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD *
DUMMY
/*
//SORTOUT   DD DUMMY
//SYSIN     DD *
  OPTION COPY
/*


and post the output

for dfsort further details can be found here
http://www.ibmmainframes.com/viewtopic.php?t=33389
- does not apply to You, but it will be useful for lurkers using DFSORT
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Thu Mar 08, 2012 1:55 pm    Post subject: Reply to: Compare trailer count with detail record
Reply with quote

Sudip,

try this code..You won't be getting RC16. It will abend with RC4.

Code:

//*                                                       
//STEP0001 EXEC  PGM=SORT,PARM='NULLOUT=RC4'             
//$ORTPARM  DD DSN=IMS.PARMLIB(IMSMS005),DISP=SHR         
//SORTIN   DD *                                           
H20120307 1148 00001                                     
3XXXXXXXXXXXXXXV11290123 6032823827 M1VDIVR CR           
3XXXXXXXXXXXXXXI11290134 6168888638 O1IDIVR CR           
3XXXXXXXXXXXXXXM11290138 6168888638 O1MDIVR CR           
3XXXXXXXXXXXXXXL11290134 6917268638 WVLDIVR CR           
3XXXXXXXXXXXXXXN11290125 9056821822 RVNDIVR CR           
3XXXXXXXXXXXXXXN11290125 9056821822 RVNDIVR CR           
3XXXXXXXXXXXXXXN11290125 9056821822 RVNDIVR CR           
T000006                                                   
//SORTOUT  DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSPRINT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=(2,1,CH,A)                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,6,ZD)),     
        IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),                       
           OVERLAY=(81:81,6,ZD,SUB,+2,EDIT=(TTTTTT)))   
   OUTFIL INCLUDE=(1,1,CH,EQ,C'T',AND,2,6,ZD,EQ,81,6,ZD)     


Note:- Tested on SYNCSORT FOR Z/OS 1.4.0.1R

Thanks
-3nadh
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Mar 08, 2012 2:08 pm    Post subject: Reply to: Compare trailer count with detail record
Reply with quote

Quote:
.You won't be getting RC16. It will abend with RC4.


in IT using the proper terminology is essential for effective communication

I find quite unlikely that something will abend with a return code

and abend is an ABEND and no RC will be generated
if the program is able to generate a RC then it did not ABEND

meditate, plese, meditate icon_cool.gif
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 2:12 pm    Post subject: Re:Compare trailer count with detail record
Reply with quote

Hi Bodatrinadh,

Thanks for your quick help.Your help is much appreciated.sort is working fine getting expected results:

Enrico

special thanks for your great suggestion.

Regards
Sudip
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Mar 08, 2012 4:22 pm    Post subject:
Reply with quote

Hi Bodatrinadh,

if TS wants a rc of 16, why not code
Code:
PARM='NULLOUT=RC16'             


Why are you sorting the records and why are you sorting on this key
Code:
  SORT FIELDS=(2,1,CH,A) 



Gerry
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Thu Mar 08, 2012 6:06 pm    Post subject: Reply to: Compare trailer count with detail record
Reply with quote

Quote:


if TS wants a rc of 16, why not code Code:
PARM='NULLOUT=RC16'



Why are you sorting the records and why are you sorting on this key Code:
SORT FIELDS=(2,1,CH,A)



Gcicchet,

Apologies for the mistake.


Sudip,
Can you try giving PARM='NULLOUT=RC16'


Thanks
-3nadh
Back to top
View user's profile Send private message
sudipghanvat

New User


Joined: 30 Mar 2010
Posts: 7
Location: pune

PostPosted: Thu Mar 08, 2012 6:08 pm    Post subject:
Reply with quote

Hi Gerry & Bodatrinadh,

Code is working fine now.I have used appropriate error code to set
after count mismatch. there is confusion now on RC codes icon_razz.gif
Also i have changed
SORT FIELDS=(2,1,CH,A)
To
SORT FIELDS=COPY

Regards,
Sudip
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us