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

Syncsort - apply header on trailer records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Aug 25, 2009 9:37 pm
Reply with quote

Hi,

My input data (RECFM=80, LRECL=FB) appears as given below:
Code:

----+----1----+----2----+----3----+----4
XXX5     DRAMTUKS1004316ZY1
40101NDSXR91G1AD5F5 A7     
40101NDSYSB1G1AD5F5 A7     
40101NDSZSC1G1AD5F5 A7     
40202NDSAXV1G1AD5F5 A7     
40203NDSB611G1AD1F5 A7     
40101NSPFCP1G1AB5F5 A7     
XXX5     DRAMTUKS1004375ZY5
16203NPQPPY1G4HB5EM AU     
16203NPQPSS1G4HB5EM AU     


I want to apply the value "DRAMTUKS10" (10th column to 24th column) on all the lines starting from 30th column.

Expected Output:
Code:

----+----1----+----2----+----3----+----4
XXX5     DRAMTUKS1004316ZY1
40101NDSXR91G1AD5F5 A7       DRAMTUKS1004316
40101NDSYSB1G1AD5F5 A7       DRAMTUKS1004316
40101NDSZSC1G1AD5F5 A7       DRAMTUKS1004316
40202NDSAXV1G1AD5F5 A7       DRAMTUKS1004316
40203NDSB611G1AD1F5 A7       DRAMTUKS1004316
40101NSPFCP1G1AB5F5 A7       DRAMTUKS1004316
XXX5     DRAMTUKS1004375ZY5
16203NPQPPY1G4HB5EM AU       DRAMTUKS1004375
16203NPQPSS1G4HB5EM AU       DRAMTUKS1004375



Please help me to achieve this using Syncsort 1.2.3

Thanks.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Fri Aug 28, 2009 8:48 am
Reply with quote

Guys, looks like this is not possible icon_sad.gif

Any alternatives would you suggest......like, using File-Aid or EZYTRIEVE.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 28, 2009 9:50 am
Reply with quote

Hello,

Any programming language can do this. . .
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 01, 2009 4:39 pm
Reply with quote

ramsri wrote:
Guys, looks like this is not possible icon_sad.gif
Nothing is impossible. icon_lol.gif

The below SyncSort job does what you asked for.
Code:
//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                               
XXX5     DRAMTUKS1004316ZY1                   
40101NDSXR91G1AD5F5 A7                       
40101NDSYSB1G1AD5F5 A7                       
40101NDSZSC1G1AD5F5 A7                       
40202NDSAXV1G1AD5F5 A7                       
40203NDSB611G1AD1F5 A7                       
40101NSPFCP1G1AB5F5 A7                       
XXX5     DRAMTUKS1004375ZY5                   
16203NPQPPY1G4HB5EM AU                       
16203NPQPSS1G4HB5EM AU                       
//T1       DD DSN=&&T1,DISP=(,PASS),UNIT=SYSDA
//T2       DD DSN=&&T2,DISP=(,PASS),UNIT=SYSDA
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),                 
        IFTHEN=(WHEN=(10,8,CH,EQ,C'DRAMTUKS'),                       
        OVERLAY=(81:SEQNUM,8,ZD)),                                   
        IFTHEN=(WHEN=NONE,                                           
        OVERLAY=(89:SEQNUM,8,ZD,81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  SORT FIELDS=COPY                                                   
  OUTFIL FNAMES=T1,BUILD=(1,88)                                       
  OUTFIL FNAMES=T2,INCLUDE=(89,1,CH,EQ,C' '),BUILD=(1,88)             
//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTOUT  DD SYSOUT=*                                               
//SORTJNF1 DD DSN=&&T1,DISP=(OLD,PASS),UNIT=SYSDA                     
//SORTJNF2 DD DSN=&&T2,DISP=(OLD,PASS),UNIT=SYSDA                     
//SYSIN    DD *                                             
  JOINKEYS FILE=F1,FIELDS=(81,8,A),SORTED                   
  JOINKEYS FILE=F2,FIELDS=(81,8,A),SORTED                   
  REFORMAT FIELDS=(F1:1,27,F2:10,15)                         
  INREC IFTHEN=(WHEN=(10,8,CH,EQ,C'DRAMTUKS'),BUILD=(1,27)),
        IFTHEN=(WHEN=NONE,BUILD=(1,27,30:28,15))             
  SORT FIELDS=COPY 
SORTOUT
Code:
XXX5     DRAMTUKS1004316ZY1                 
40101NDSXR91G1AD5F5 A7       DRAMTUKS1004316
40101NDSYSB1G1AD5F5 A7       DRAMTUKS1004316
40101NDSZSC1G1AD5F5 A7       DRAMTUKS1004316
40202NDSAXV1G1AD5F5 A7       DRAMTUKS1004316
40203NDSB611G1AD1F5 A7       DRAMTUKS1004316
40101NSPFCP1G1AB5F5 A7       DRAMTUKS1004316
XXX5     DRAMTUKS1004375ZY5                 
16203NPQPPY1G4HB5EM AU       DRAMTUKS1004375
16203NPQPSS1G4HB5EM AU       DRAMTUKS1004375
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Thu Sep 03, 2009 2:26 pm
Reply with quote

Excellent........Thank you icon_biggrin.gif
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top