How to include Year in Header1



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

How to include Year in Header1

Postby ankushgattani » Wed Aug 29, 2012 2:48 pm

I need to include Current year (only year, not complete date) in the header1 of my output file.
all the functions specified in the manual include DATE or MONTH also in the output.
i need only the year (ex : 2012).

Currently i am doing it like this to generate the header record alone

  OPTION COPY                                                           
  OUTFIL FNAMES=RPTHDR,                                                 
  OVERLAY=(&DATE2,5:2X)           


i generate rest of the report in another sort, then combine both the SORT output using IEBGENER.

How can i achieve it using one SORT step only.
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to include Year in Header1

 

Re: How to include Year in Header1

Postby NicC » Wed Aug 29, 2012 3:30 pm

Please do not double post. Are you using DFSORT or SYNCSORT? Just look at the messages from the sort product - not at which program you executed as this is often SORT which is aliased to the real program name.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to include Year in Header1

Postby ankushgattani » Wed Aug 29, 2012 3:34 pm

I am sorry, just checked the spool. I am using SyncSort.
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to include Year in Header1

Postby BillyBoyo » Wed Aug 29, 2012 5:02 pm

Well, in DFSORT you can specify a coulmun: in HEADER1. Can you do that with Syncsort? Then do as you've done above.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include Year in Header1

Postby ankushgattani » Wed Aug 29, 2012 5:25 pm

Already tried it. We cant use OVERLAY for HEADER1. It gives a Syntax error.
In my logic, i am overlapping the last two digits of YYYYDD by SPACES.Overlapping is not possible in HEDAER1 or OUTREC or BUILD.
So for my logic OVERLAY is a must, which sadly is not an option with HEADER1.
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to include Year in Header1

Postby BillyBoyo » Wed Aug 29, 2012 5:54 pm

Can you show what you have tried, please?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include Year in Header1

Postby ankushgattani » Thu Aug 30, 2012 3:24 pm

This is what i tried

//JS20    EXEC PGM=SORT                         
//SYSOUT    DD SYSOUT=*                         
//SYSPRINT  DD SYSOUT=*                         
//SORTMSG   DD SYSOUT=*                         
//SORTIN    DD DSN=TEST.SORT.OUT.RPT,DISP=SHR   
//RPT       DD DSN=TEST.SORT.OUT.RPT323B,       
//             SPACE=(CYL,(1,1),RLSE),           
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
//             DISP=(NEW,CATLG,DELETE)           
//SYSIN DD *                                     
  OPTION COPY                                   
  OUTFIL FNAMES=RPT,                             
  HEADER1 OVERLAY=(DATE,5:2X)                   
/*                                               



It gives me Syntax error. Following is the Snapshot of the spool error
SYSIN :                                         
  OPTION COPY                                   
  OUTFIL FNAMES=RPT,                             
  HEADER1 OVERLAY=(DATE,5:2X)                   
         *                                       
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to include Year in Header1

Postby BillyBoyo » Thu Aug 30, 2012 3:45 pm

can you try?
  HEADER1=(DATE,5:2X)   
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to include Year in Header1

Postby ankushgattani » Thu Aug 30, 2012 5:20 pm

I tried the code, getting the following error:

 WER118A  RPT      ILLEGAL OVERLAPPING FIELDS
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to include Year in Header1

Postby BillyBoyo » Thu Aug 30, 2012 5:33 pm

OK. I was sort of worried you may get that result :-)

The HEADER1 is allowing columns (the : bit) but it is, unlike OVERLAY, not allowing them to be used to overwrite existing data - which, on a heading line, is much more often than not, what you want.

If you look at your manual, it will explain this to you.

Look at samples in the manual of using HEADER1.

It may be that you cannot do what you want.

I don't have time to do any research today, so you'll have to: can you get anything from a record into HEADER1?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post