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
 

 

Header and Trailer problem in a FB File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Header and Trailer problem in a FB File
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 Moderator


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

PostPosted: Wed May 16, 2007 10:53 pm    Post subject:
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    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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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