MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overlay header on trailer records.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Aug 28, 2009 6:02 am    Post subject: Overlay header on trailer records. Reply with quote

Hi, My input file (LRECL=40, RECFM=FB) appears like...
Code:

----+----1----+----2----+----3----+----4
$400 ON 01/01/09
FREDRICK
DONALD
ELIZZA
$2000 ON 08/01/09
ROY
MELISSA
$10 ON 03/15/09
DANIEL
LIZ
MAGGY


I want the header to be overlaid onto each trailer at 30th position onwards.

Output:
Code:

----+----1----+----2----+----3----+----4----+----5
$400 ON 01/01/09                             
FREDRICK                     $400 ON 01/01/09
DONALD                       $400 ON 01/01/09
ELIZZA                       $400 ON 01/01/09
$2000 ON 08/01/09                             
ROY                          $2000 ON 08/01/09
MELISSA                      $2000 ON 08/01/09
$10 ON 03/15/09                               
DANIEL                       $10 ON 03/15/09 
LIZ                          $10 ON 03/15/09 
MAGGY                        $10 ON 03/15/09 


Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Aug 28, 2009 10:00 am    Post subject: Reply with quote

ranga_subham,

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=your 40 byte FB file,DISP=SHR     
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'$'),PUSH=(30:1,16))
/*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Aug 28, 2009 10:46 am    Post subject: Reply with quote

Kolusu, Thanks.

I have added some more code to your solution because I DON'T want the header to appear along with it again.

Code:

//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'$'),PUSH=(30:1,16))
  OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'$'),BUILD=(1,16,64X)),     
         IFTHEN=(WHEN=(1,1,FS,EQ,NUM),BUILD=(1,80))             
/*                                                               


Please let me know if this can be bettered.

Thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Aug 28, 2009 10:55 am    Post subject: Reply with quote

ranga_subham,

You don't need OUTREC. use the following control cards
Code:

//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'$'),PUSH=(30:1,16)),
  IFTHEN=(WHEN=(1,1,CH,EQ,C'$'),OVERLAY=(30:16X))                 
/* 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ranga_subham
Intermediate


Joined: 31 Jan 2006
Posts: 255
Topics: 72

PostPosted: Fri Aug 28, 2009 10:59 am    Post subject: Reply with quote

wow.....excellent......thanks.
_________________
Ranga
*****
None of us is as smart as all of us - Ken Blanchard
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group