Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2296
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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us