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
 

 

Updating header with recounds count

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

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Thu Aug 02, 2007 5:26 pm    Post subject: Updating header with recounds count
Reply with quote

Suppose, I have file with '10' records. The header is showing the count of all records in the file. This file has some duplicate records.... say for ex. 2 duplicate records.

I need to create a new file by remove the duplicate records and updating count in the header record. i.e. my new file should have 8 records (after removing the 2 duplicate records from the file of 10 records) and header record should show the count as 8.

Please note that record counts and duplicate records will vary from file to file.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 02, 2007 5:37 pm    Post subject:
Reply with quote

Nanda Krishna
Give the sample set of i/p records, with the header format.
and also the o/p records.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 02, 2007 8:58 pm    Post subject:
Reply with quote

Also, give the RECFM and LRECL of the input file and the starting position, length and format of the field you are using to check for duplicates.
Back to top
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Fri Aug 03, 2007 9:29 am    Post subject: Re: Updating header with recounds count
Reply with quote

* RECFM = VB
* LRECL = 304
* starting position, length and format of the field you are using to check
for duplicates = (1, 13, CHAR) i.e. SORT FIELDS=(1,13,CH,A)
* In the header, record count is from pos 59-62 (length of 4 char)
* Input file and Output file are of same format and length.

Please let me know if you need any other information. Thanks in Advance icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 03, 2007 8:03 pm    Post subject:
Reply with quote

Quote:
Please let me know if you need any other information.


Please show an example of the records in the input file (just the relevant fields) and the records you expect in the output file.
Back to top
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Sat Aug 04, 2007 7:23 pm    Post subject: Re: Updating header with recounds count
Reply with quote

Sample input file:
--------------------

Code:

Header:
---------
AX00 20070804025000RAMTX00056790                    00000000051357
* Here 0005 is the records count excluding hdr record and it starts
from pos. 59

Detail records:
-----------------
DRAPBBXA0
DRAPBBXA1
DRAPBBXA2 --> Duplicate record
DRAPBBXA2 --> Duplicate record
DRAPBBXA3


Sample output file should be ....
--------------------------------

Code:

Header:
---------
AX00 20070804025000RAMTX00056790                    00000000041357

Detail records:
-----------------
DRAPBBXA0
DRAPBBXA1
DRAPBBXA2
DRAPBBXA3


* One duplicate record(DRAPBBXA2) from the i/p file removed and the
header count is updated from 5 to 4.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Aug 04, 2007 9:22 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. Since the input file is VB, we need to add 4 bytes (for the RDW) to your starting positions. I assumed that the header record can be identified by the 'A' in position 1.

Code:

//S1    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD DSN=...  input file (VB)                             
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)       
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)     
//SYSIN    DD    *                                               
  SORT FIELDS=(5,13,CH,A)                                       
  SUM FIELDS=NONE                                               
  OUTFIL FNAMES=T1                                               
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,VTOF,                     
    BUILD=(80X),                                                 
    TRAILER1=('NEWCT,''',COUNT-1=(M11,LENGTH=4),C'''')           
/*
//S2    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                           
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)                             
//SORTOUT DD DSN=... output file (VB)                             
//SYSIN    DD    *                                               
  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(5,1,CH,EQ,C'A'),                           
    OVERLAY=(63:NEWCT))                                         
/*
Back to top
View user's profile Send private message
Nanda Krishna

New User


Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

PostPosted: Tue Aug 07, 2007 2:26 pm    Post subject: Re: Updating header with recounds count
Reply with quote

Hi Frank,

Thanks for the DFSORT job. It is working as per expectations. But, when i am checking for syntax errors, i am getting the following error msg...(but the job ended with rc 00). Could you explain why it is so? Thanks for your time.

Sev Msg No. Message Text
-----------------------------------------------------
E1 8 DSS10065E Parameter 'COUNT-1' is unidentified.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 07, 2007 8:21 pm    Post subject:
Reply with quote

Huh? Checking for syntax errors how? If you received a DFSORT syntax error, it would be an ICExxxA message and you would not get RC=0.

Quote:
E1 8 DSS10065E Parameter 'COUNT-1' is unidentified.


This message is NOT from DFSORT. What program are you running that produces this error message?
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 How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


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