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

Updating multiple counts in trailer!!


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Mon Nov 06, 2017 1:04 pm
Reply with quote

Hi all,

I have an input file

ACTION
ENT
ENT
ENT
GROUP
GROUP
RESOURCE
RESOURCE
"ENDOFDATA","RECORDCOUNT={TOTCNTXXXX};PRINCIPAL_RECORDCOUNT={0};GROUP_RECORDCOUNT={8657};ACTION_RECORDCOUNT={1};ACTIONGROUP_RECORDCOUNT={0};RESOURCE_RECORDCOUNT={RESCNTXXXX};RESOURCEGROUP_RECORDCOUNT={0};PRINCIPALID_COUNT={0};COMITID_COUNT={0};PRINCIPALGROUP_COUNT={GRPCNTXXXX};PRINCIPALROLE_COUNT={GRPCNTXXXX};ACTION_COUNT={1};ACTIONGROUP_COUNT={0};RESOURCE_COUNT={RESCNTXXXX};RESOURCEGROUP_COUNT={0};RESOURCE_PRODUCT_RECORDCOUNT={0};RESOURCE_PRODUCT_COUNT={0};RESOURCE_PRODUCT_GROUP_RECORDCOUNT={0};RESOURCE_PRODUCT_GROUP_COUNT={0};RESOURCE_ACCOUNT_RECORDCOUNT={0};RESOURCE_ACCOUNT_COUNT={0};RESOURCE_ACCOUNT_GROUP_RECORDCOUNT={0};RESOURCE_ACCOUNT_GROUP_COUNT={0};ENTITLEMENT_RECORDCOUNT={ENTCNTXXXX};ENTITLEMENT_COUNT={ENTCNTXXXX};"

Here end of data is the trailer record where the count needs to be updated. Here count needs to be updated at 8 locations through four variables (TOTCNTXXXX, GRPCNTXXXX, RESCNTXXXX and ENTCNTXXXX).

TOTCNTXXXX - Total count of input file (Here 8)
GRPCNTXXXX - Total count of group (Here 2)
RESCNTXXXX - Total count of resource (Here 2)
ENTCNTXXXX - Total count of ENT (Here 3)

This file is of record length 850 and FB. Could anyone help me with a sort to overlay the above counts in the end of data record at corresponding positions?

Thanks,
Viky.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Nov 06, 2017 2:54 pm
Reply with quote

searching the forums with "overlay trailer" returned about 120 hits
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Nov 06, 2017 4:13 pm
Reply with quote

I would suggest that you:
a) follow up Enrico's information
b) provide a record layout of the relevant record and what needs to be done to which field as what you have supplied is 'rubbish'
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Mon Nov 06, 2017 4:47 pm
Reply with quote

Shall I use the following sort card:

Code:
//SORT12  EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=input1,DISP=SHR         
//         DD DSN=input2,DISP=SHR             
//SORTOUT  DD DSN=TETEST.W.TELECASH.TEST.CEEPFIL1,                   
//            DISP=(OLD,CATLG,DELETE),UNIT=SYSDA,                     
//            DCB=(RECFM=FB,LRECL=850,BLKSIZE=0),                     
//            SPACE=(CYL,(500,500),RLSE)                             
//SYSIN DD *                                                         
  OUTFIL FNAMES=SORTOUT,IFTRAIL=(TRLID=(2,3,CH,EQ,C'END'),           
  TRLUPD=(27:COUNT=(M11,LENGTH=10),                                   
    169:COUNT=(2,3,CH,EQ,C'RES',M11,LENGTH=10),                       
    274:COUNT=(2,3,CH,EQ,C'GRO',M11,LENGTH=10),                       
    629:COUNT=(2,3,CH,EQ,C'ENT',M11,LENGTH=10)))                     
/*

For the above query I get the following error:
Code:
  OUTFIL FNAMES=SORTOUT,IFTRAIL=(TRLID=(2,3,CH,EQ,C'END'),                   
  TRLUPD=(27:COUNT=(M11,LENGTH=10),
                                                             *
    169:COUNT=(2,3,CH,EQ,C'RES',M11,LENGTH=10),                                         
    274:COUNT=(2,3,CH,EQ,C'GRO',M11,LENGTH=10),                               
    629:COUNT=(2,3,CH,EQ,C'ENT',M11,LENGTH=10)))                             
WER813I  INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED               
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Coded for you - next time do it yourself
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Nov 06, 2017 6:26 pm
Reply with quote

add a ,?
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top