IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare trailer count with detail record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Thu Mar 08, 2012 10:54 am
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
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
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: 1702
Location: Australia

PostPosted: Thu Mar 08, 2012 12:14 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 08, 2012 12:40 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 08, 2012 1:12 pm
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 08, 2012 2:08 pm
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
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: 1702
Location: Australia

PostPosted: Thu Mar 08, 2012 4:22 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top