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

Header and Trailer problem in a FB File


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

New User


Joined: 21 Dec 2006
Posts: 27
Location: india

PostPosted: Wed May 16, 2007 9:41 pm
Reply with quote

Hi ALL,

I have 2 files.
First is a FB file of 120 LRECL and it contains only one record.

00789 02012007101010

the second file is a VBA file of LRECL = 8192.
It has one header and one trailer. i.e.

1234HEADER******************************
-------------
-------------
-------------
3223TRAILE*******************************


i want to make one output file which should be like this

1234HEADER790***************************
-------------
-------------
-------------
3223TRAILEaaaaa**************************


Here in this file, 790 is from first file (789 + 1)
aaaaa is the count of records in second file (excluding header and trailer)


thanks and regards
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: Wed May 16, 2007 10:53 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked. Since your input file has RECFM=VBA, I assumed the data you show (e.g. '1234HEADER') started in position 6 after the RDW and carriage control character.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file (FB/120)
//IN2 DD DSN=...  input file (VBA/8192)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(MOD,PASS)
//TOOLIN   DD    *
COPY FROM(IN1) TO(SYM) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC BUILD=(C'HDVAL,''',3,3,ZD,ADD,+1,EDIT=(TTT),C'''',80:X)
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,VTOF,
    BUILD=(80X),
    TRAILER1=(C'TRVAL,''',COUNT-2=(EDIT=(TTTTT)),C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&I2,DISP=(OLD,PASS)
//SORTOUT DD DSN=...  output file (VBA/8192)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(10,6,CH,EQ,C'HEADER'),
     OVERLAY=(16:HDVAL)),
   IFTHEN=(WHEN=(10,6,CH,EQ,C'TRAILE'),
    OVERLAY=(16:TRVAL))
/*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top