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

Appending from one file to other and updating trailer count


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Dec 06, 2007 3:21 pm
Reply with quote

Hi All,
I have two file of same format with Header and trailer. I want to append records from one file say File B to another file say File A, and I have to update the trailer count of the file A to which the records are appended. So now the Trailer count in File A will be (No of records in File A + No of records appended from File B).

sample look alike of the file is shown below.

AAAAAAAA944220071205
06446236 010A
06446237 010A
06446238 010A
06446239 010A
06446240 010A
06446241 010A
06446242 010A
99999999000007


Header will start with 'A in first 8 bytes. The trailer will start with '9' in first 8 bytes and 6 bytes after this will be the count of the records in the file (in the above case it is 000007). The files are VB file with Lrecl 436.

Another important thing, ICETOOL wont work in my system. Only DFSORT will work. So could any one tell me can this requirement be done with DFSORT tool. Please let me know at the earliest.

I searched the forum but end up with results having only ICETOOL to accomplish the requirements similar to mine. Please advice.


Thanks and Regards,
Sakthivel.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Dec 06, 2007 3:23 pm
Reply with quote

Sakthi,

This was discussed earlier. Search forum.

Quote:
Another important thing, ICETOOL wont work in my system. Only DFSORT will work

Are you sure?
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Dec 06, 2007 3:35 pm
Reply with quote

ya I am sure. Thats why I posted otherwise I could have used the results from my search. All the results of my search are explained with ICETOOL only. It is not working in my system. I dont know much about the configuration but I am saying this after getting error when I run the code posted in the searched forums.

Sakthi.
Back to top
View user's profile Send private message
sakthi_ksv

New User


Joined: 20 Jul 2006
Posts: 48
Location: Chennai

PostPosted: Thu Dec 06, 2007 9:29 pm
Reply with quote

Hello everybody, I have searched the forum none of the previos question matches mine. there is a slight difference, Please help me on this. Please help me on ICETOOL itself. I am using the following code. It giving error which is given below,

Code:

//S020   EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG DD SYSOUT=*                                           
//IPFILES DD DSN=XIND81.CRO9441.FILE0002.FTPDATA,DISP=SHR     
//        DD DSN=XIND81.CRO9441.FILE0002.FTPDATA.NEW,DISP=SHR 
//OPFILE DD  DSN=XIND81.CRO9441.FILE0002.FTPDATA.OUT,         
//         DISP=(MOD,CATLG),                                   
//         UNIT=DISK,SPACE=(CYL,(30,10),RLSE),                 
//         DCB=(RECFM=VB,LRECL=436,BLKSIZE=23476)             
//TOOLIN DD *                                                 
  COPY FROM(IPFILES) TO(OPFILE) USING(HEAD)                   
  SORT FROM(IPFILES) TO(OPFILE) USING(DETL)                   
  SORT FROM(IPFILES) TO(OPFILE) USING(TRIL)                   
/*                                                             
//HEADCNTL DD *                                               
**** COPY HEADER TO OP FILE                                   
  SORT FIELDS=COPY,STOPAFT=1                                   
/*                                                             
//*                                                           
//DETLCNTL DD *                                               
***** COPY DETAILED RECORDS WITH SORT OPER                     
  SORT FIELDS=COPY                                             
  OMIT COND=(5,8,CH,EQ,C'AAAAAAAA',OR,5,8,CH,EQ,C'99999999')   
/*                                                             
//*                                                           
//TRILCNTL DD *                                               
*** TRAILER RECORD                                             
  SORT FIELDS=(5,8,CH,A)                                       
  OUTFIL FNAMES=OPFILE REMOVECC,NODETAIL,                     
  SECTIONS=(5,8,                                               
  TRAILER1=(5,8,14:TOT=(14,6,ZD,EDIT=(TT))))                   




the error is

Code:

ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 15:55 ON THU DEC
          *** TRAILER RECORD                                                   
            SORT FIELDS=(5,8,CH,A)                                             
            OUTFIL FNAMES=OPFILE REMOVECC,NODETAIL,                             
            SECTIONS=(5,8,                                                     
            $                                                                   
ICE005A 0 STATEMENT DEFINER ERROR                                               
            TRAILER1=(5,8,14:TOT=(14,6,ZD,EDIT=(TT))))                         
            $                                                                   
ICE005A 0 STATEMENT DEFINER ERROR                                               
ICE146I 0 END OF STATEMENTS FROM TRILCNTL - PARAMETER LIST STATEMENTS FOLLOW   
          DEBUG NOABEND,ESTAE                                                   
          OPTION LIST,MSGPRT=ALL,MSGDDN=DFSMSG,RESINV=0,SORTDD=TRIL,SORTIN=IPFIL
                         S,SORTOUT=OPFILE,DYNALLOC                             
ICE052I 3 END OF DFSORT                                                         



Please help me on this, it is very urgent
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Dec 06, 2007 11:13 pm
Reply with quote

The problem is NOT that you can't use ICETOOL. The problem is that you have errors in the control statements.

Code:

  OUTFIL FNAMES=OPFILE REMOVECC,NODETAIL,                             
            SECTIONS=(5,8, 
            TRAILER1=(5,8,14:TOT=(14,6,ZD,EDIT=(TT))))                         


You have a blank after FNAMES=OPFILE instead of a comma. The blank ends the OUTFIL statement so the next line is flagged as an error. You also have TRAILER1 which is invalid for SECTIONS - you need TRAILER3 with SECTIONS. So the statements should be:

Code:

  OUTFIL FNAMES=OPFILE,REMOVECC,NODETAIL,                             
            SECTIONS=(5,8, 
            TRAILER3=(5,8,14:TOT=(14,6,ZD,EDIT=(TT)))) 


I can't figure out what you're trying to do here. 14,6,ZD doesn't seem to be a valid ZD field.

You would have done better to spend more time showing your input and output and what you wanted to accomplish rather than complaining about how you can't use ICETOOL.

I think you want to combine the two input files to get an output file with just one header, the sorted data records, and a trailer with the count of data records. I believe this DFSORT/ICETOOL job will do that.

Code:

//S020   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IPFILES DD DSN=XIND81.CRO9441.FILE0002.FTPDATA,DISP=SHR
//        DD DSN=XIND81.CRO9441.FILE0002.FTPDATA.NEW,DISP=SHR
//OPFILE DD  DSN=XIND81.CRO9441.FILE0002.FTPDATA.OUT,
//         DISP=(MOD,CATLG),
//         UNIT=DISK,SPACE=(CYL,(30,10),RLSE),
//         DCB=(RECFM=VB,LRECL=436,BLKSIZE=23476)
//TOOLIN DD *
  COPY FROM(IPFILES) TO(OPFILE) USING(HEAD)
  SORT FROM(IPFILES) TO(OPFILE) USING(DETL)
  COPY FROM(IPFILES) TO(OPFILE) USING(TRIL)
/*
//HEADCNTL DD *
**** COPY HEADER TO OP FILE
  SORT FIELDS=COPY,STOPAFT=1
/*
//*
//DETLCNTL DD *
***** COPY DETAILED RECORDS WITH SORT OPER
  OMIT COND=(5,8,CH,EQ,C'AAAAAAAA',OR,5,8,CH,EQ,C'99999999')
  SORT FIELDS=(5,8,CH,A)
/*
//*
//TRILCNTL DD *
*** TRAILER RECORD
  OUTFIL FNAMES=OPFILE,REMOVECC,NODETAIL,
  TRAILER1=(5,8,14:COUNT-4=(EDIT=(TT)))
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top