Copy value from Header to detail records



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Re: Copy value from Header to detail records

Postby Alissa Margulies » Tue Aug 11, 2009 7:42 pm

tvssv wrote: SORT FIELDS=COPY -Added this statement because it was giving sort missing error
Sorry, that was a simple error of missing a piece from cut/paste on my part.

tvssv wrote:Can you please explain what is the use of INCLUDE=(1,4,CH,EQ,L(C'09IN',X'00000000',X'FFFFFFFF')),statment.

That is a simplified way of coding the following:
INCLUDE=(1,4,CH,EQ,C'09IN',OR,
         1,4,CH,EQ,X'00000000',OR,
         1,4,CH,EQ,X'FFFFFFFF')
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Copy value from Header to detail records

Postby arcvns » Tue Aug 11, 2009 11:28 pm

REFORMAT FIELDS=(F1:1,70,F2:1,8),FILL=(X'40')
- changed to X'40' since it was writing high values in header and trailer
SORT FIELDS=(1,4,CH,A)
OUTREC IFTHEN=(WHEN=(71,8,CH,NE,X'FF'),
BUILD=(1,55,71,8,64,7)),
IFTHEN=(WHEN=NONE,BUILD=(1,70))
tvssv,

You have used the fill byte as space-X'40'; but you're still checking for X'FF' instead of spaces.

BTW the default FILL is spaces. You need not mention it explicitly unless you want something specific. You can even omit the 'FILL' paramter and check for spaces down the line - 71,8,CH,NE,C' '
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Copy value from Header to detail records

Postby arcvns » Wed Aug 12, 2009 12:21 am

tvssv,

Here's an alternative approach which I think would do the same.(Untested). I assumed your input as FB/LRECL=70.

//S1     EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD DSN=INPUT.FILE,DISP=SHR             
//T1       DD DSN=&&T1,DISP=(NEW,PASS)         
//SYSIN    DD *                                                     
  SORT FIELDS=COPY,STOPAFT=1     
  OUTFIL FNAMES=T1,BUILD=(C'DATE-X,''',15,8,C'''',80:X)
/*                                 
//S2     EXEC PGM=SORT                         
//SORTIN   DD DSN=INPUT.FILE,DISP=SHR             
//SYMNAMES DD DSN=&&T1,DISP=(OLD,PASS)         
//SORTOUT  DD DSN=OUTPUT.FILE,...             
//SYSOUT   DD SYSOUT=*                         
//SYSIN     DD *                               
  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'09IN'),                               
  BUILD=(C'7808',10,10,23,10,20,03,40:05,04,50,04,C'Y',
         23,06,09,01,DATE-X,70:X))                                   
/*
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Copy value from Header to detail records

Postby tvssv » Thu Aug 13, 2009 4:40 pm

Hi Arcvns,

Thank you.

With the following change it is working fine.
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,4,CH,EQ,L(C'09IN',X'00000000',X'FFFFFFFF'))
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'09IN'),
BUILD=(C'7808',10,10,23,10,20,03,40:05,04,50,04,C'Y',
23,06,09,01,DATE-X,70:X))
/*
Otherwise it is copying all the records but formatting only '09IN' records.

Thankyou.

Can you help me to get some documents for syncsort guide or any URL.

Thanks & REgards
Tvssv
tvssv
 
Posts: 6
Joined: Mon Aug 10, 2009 8:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Copy value from Header to detail records

Postby Alissa Margulies » Thu Aug 13, 2009 8:05 pm

tvssv wrote:Can you help me to get some documents for syncsort guide or any URL.

Thanks & REgards
Tvssv

Please contact me offline at alissa.margulies@syncsort.com and I would be happy to assist you with acquiring the manuals.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Previous

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post