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
 

 

Adding trailer to every record in a file

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

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Sat Oct 18, 2008 12:22 am    Post subject: Adding trailer to every record in a file
Reply with quote

Hi,

How can i add trailer record to every record in the file.

Ex:

11111
22222
33333
44444
TTTTT <<----Trailer

My output should look like

11111 TTTTT
22222 TTTTT
33333 TTTTT
44444 TTTTT

Note: I can't predict the trailer. It can be anything.

Can i achieve this with sort with out hard coding the trailer in my sort card?

Thanks.
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 Oct 18, 2008 12:57 am    Post subject:
Reply with quote

You mean you want to append the trailer record to every record of the file?

What is the RECFM and LRECL of the input file?

Do you want the output record to contain each complete data record + the trailer record? Or do you want something else?

What would the RECFM and LRECL of the output file?

Quote:
I can't predict the trailer. It can be anything.


So there's nothing in the trailer record that identifies it as the trailer record (e.g. '9' in column 1)? It can only be identified as the last record?
Back to top
View user's profile Send private message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Sat Oct 18, 2008 1:26 pm    Post subject: Reply to: Adding trailer to every record in a file
Reply with quote

Quote:
You mean you want to append the trailer record to every record of the file?

yes

Quote:
What is the RECFM and LRECL of the input file?

Fixed and 80 bytes

Quote:
Do you want the output record to contain each complete data record + the trailer record? Or do you want something else?

Just want to append trailer to each data record.


Quote:
What would the RECFM and LRECL of the output file?

same file for input and output.


Quote:
So there's nothing in the trailer record that identifies it as the trailer record (e.g. '9' in column 1)? It can only be identified as the last record?

Yes.[/quote]
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 Oct 18, 2008 9:03 pm    Post subject:
Reply with quote

Quote:
What would the RECFM and LRECL of the output file?

same file for input and output


If the input file has RECFM=FB and LRECL=80 and you want the output file to have the record + trailer, that would make it 160 bytes, so you would need the output LRECL to be 160 - right? If not, then explain how you're going to fit 160 bytes into an output data set with LRECL=80.

If you only want certain positions from the data records and certain positions from the trailer record, then you have to tell me which positions you want from each.
Back to top
View user's profile Send private message
sriramvempaty

New User


Joined: 02 Aug 2007
Posts: 18
Location: india

PostPosted: Mon Oct 20, 2008 9:12 pm    Post subject: Reply to: Adding trailer to every record in a file
Reply with quote

Sorry for not making you understand my requirements clearly.

My input file is of 80 bytes and i have data from 1 to 10 bytes only and rest 70 bytes are for future use.

Ex:- 1---10-----20-----30------40-----------80
aaaaa
bbbbb
cccccc
TTTTT

I want to append the last data record to each and every data record (except trailer data record).

My output should look similar to
1---10-----20-----30------40-----------80
aaaaaTTTTT
bbbbbTTTTT
ccccccTTTTT

Total no.of bytes will now be 20.

Lrecl will still be 80 bytes.
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: Mon Oct 20, 2008 9:38 pm    Post subject:
Reply with quote

It's difficult to tell what you want since you didn't use ubb codes for your examples.

Assuming that you want to append the 10 bytes from positions 1-10 of the trailer record to positions 11-20 of every other record (and not squeeze out the blanks), here's a DFSORT/ICETOOL job that will do it.

Code:

//S1    EXEC  PGM=ICETOOL                                         
//TOOLMSG   DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//IN DD DSN=...  input file (FB/80)                                   
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
//OUT DD DSN=...  output file (FB/80)                               
//TOOLIN   DD    *                                                 
COPY FROM(IN) USING(CTL1)                                         
COPY FROM(IN) TO(OUT) USING(CTL2)
/*                                 
//CTL1CNTL DD *                                                   
  INREC OVERLAY=(81:SEQNUM,8,ZD,START=0)                           
  OUTFIL FNAMES=CTL2CNTL,REMOVECC,NODETAIL,                       
    BUILD=(1,80),                                                 
    TRAILER1=('  OPTION COPY,STOPAFT=',81,8,/,                     
      '  OUTFIL OVERLAY=(11:C''',1,10,''')')                       
/*
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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