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
 

 

Syncsort - apply header on trailer records.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - apply header on trailer records.
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    Post subject: Is not possible?
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

Site Director


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

PostPosted: Fri Aug 28, 2009 9:50 am    Post subject:
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: 2239
Location: @my desk

PostPosted: Tue Sep 01, 2009 4:39 pm    Post subject: Re: Is not possible?
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    Post subject: Reply to: Syncsort - apply header on trailer records.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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