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
 

 

Validate the trailer count and update the count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Tue May 24, 2011 3:56 pm    Post subject: Validate the trailer count and update the count
Reply with quote

Hi,

The input file contain header and trailer record.
I need to validate the the trailer count and modify if it is not correct.(not necessary to validate and change, write the correct count will do)

For example the trailer count is 8 in input it should be modified to 5.
Can this be done using sort/icetool....
Input:

****** ***************************** Top of Data **********
000001 H0000000501IACT20110323
000002 TESTRSE195201051243863861334A2440010
000003 TESTRSE195201241545803586CF175842910
000004 TESTRSE19520310257372484488162179D20
000005 TESTRSE19531002157202013600022076310
000006 TESTRSE195406051558749377431A6286510
000007 T0000000501IACT20110323000000008
****** **************************** Bottom of Data ********

Output should be:


****** ***************************** Top of Data *******
000001 H0000000501IACT20110323
000002 TESTRSE195201051243863861334A2440010
000003 TESTRSE195201241545803586CF175842910
000004 TESTRSE19520310257372484488162179D20
000005 TESTRSE19531002157202013600022076310
000006 TESTRSE195406051558749377431A6286510
000007 T0000000501IACT20110323000000005
****** **************************** Bottom of Data *****

thanks,
Gilesh
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 24, 2011 4:27 pm    Post subject:
Reply with quote

Read through these..... to reach your solution..
http://ibmmainframes.com/viewtopic.php?t=54023&highlight=update+trailer+count
http://ibmmainframes.com/viewtopic.php?t=18180&highlight=update+trailer+count
http://ibmmainframes.com/viewtopic.php?t=26548&highlight=update+trailer+count
http://ibmmainframes.com/viewtopic.php?t=26548&highlight=update+trailer+count
http://ibmmainframes.com/viewtopic.php?t=33057&highlight=update+trailer+count
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1504
Location: Chennai

PostPosted: Tue May 24, 2011 5:09 pm    Post subject:
Reply with quote

Hello,
Here is One using ICETOOL, IDK if maybe effecient than other methods or anywhere near to being effecient, but it maybe simple to understand.

Code:
//JS020    EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//SORTIN   DD DISP=SHR,DSN=WELLS.SORTIN             
//SORTOUT  DD DSN=WELLS.SORTOUT,DISP=MOD           
//SYSOUT   DD SYSOUT=*                               
//TOOLIN   DD *                                       
  SUBSET FROM(SORTIN) TO(SORTOUT) INPUT REMOVE LAST(1)
  COPY FROM(SORTIN) TO(SORTOUT) USING(CTL1)           
/*                                                   
                                                     
//CTL1CNTL   DD *                                     
  OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,           
      TRAILER1=(1,23,COUNT-2=(M11,LENGTH=9),48X)     
/*                                                   
//SYSUDUMP DD SYSOUT=*                               
/*                                                   



NOTE: There is a DISP=MOD in SORTOUT.

Hope it helps.
Back to top
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Tue May 24, 2011 6:09 pm    Post subject:
Reply with quote

Thanks...
This will create another trailer record.
can you please tell how I can update the trailer without creating another record?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1504
Location: Chennai

PostPosted: Tue May 24, 2011 6:25 pm    Post subject:
Reply with quote

Hello,
The above program is updating the record that is already there or creating a new one.

If you spot a difference let me know.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue May 24, 2011 8:12 pm    Post subject:
Reply with quote

gileshpg,
If you have latest PTF for DFSort (Oct,2010)installed then you may use below jcl to update trailer count. I am assuming that TRAILER can be identified by 'T0000000' in the first 8 position and your count start at 25th position for 8 bytes.

Code:
//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
H0000000501IACT20110323                                 
TESTRSE195201051243863861334A2440010                   
TESTRSE195201241545803586CF175842910                   
TESTRSE19520310257372484488162179D20                   
TESTRSE19531002157202013600022076310                   
TESTRSE195406051558749377431A6286510                   
T0000000501IACT20110323000000008                       
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
 OPTION COPY                                           
 OUTFIL IFTRAIL=(HD=YES,TRLID=(1,8,CH,EQ,C'T0000000'), 
                 TRLUPD=(25:COUNT=(M11,LENGTH=8)))     
/*                                                     
//*                                                     


OUTPUT
Code:
H0000000501IACT20110323               
TESTRSE195201051243863861334A2440010 
TESTRSE195201241545803586CF175842910 
TESTRSE19520310257372484488162179D20 
TESTRSE19531002157202013600022076310 
TESTRSE195406051558749377431A6286510 
T0000000501IACT20110323000000005     


Thanks,
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1824
Location: UK

PostPosted: Tue May 24, 2011 9:40 pm    Post subject:
Reply with quote

If you are getting a difference between the number of records and the count then you hould fix the program creating the file. How do you know if there are actual records missing or not missing?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


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