Page 1 of 1

print julian date in header using sort

PostPosted: Wed Feb 22, 2012 8:48 pm
by rgollapa
Hi,

can someone let me know how to print the Julian date in header record.

i have a requirement where i need to print the julian date in YYYYDDD format.

Re: print julian date in header using sort

PostPosted: Wed Feb 22, 2012 10:27 pm
by bodatrinadh
Rgollapa,

Try this snippet.

//STEP1    EXEC PGM=SORT                                         
 //SYSOUT   DD SYSOUT=*                                           
 //SORTIN   DD *                                                   
 HEADER                                                           
 REC1                                                             
 REC2                                                             
 REC3                                                             
 REC4                                                             
 //SORTOUT   DD SYSOUT=*                                           
 //SYSIN    DD *                                                   
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=(1,10,SS,EQ,C'HEADER'),                       
         OVERLAY=(15:DATE3))                                       
 //*   

Output :-

HEADER        2012053                   
REC1                                   
REC2                                   
REC3                                   
REC4                                                                                           



Thanks
-3nadh

Re: print julian date in header using sort

PostPosted: Thu Feb 23, 2012 10:02 am
by rgollapa
below is my sort card
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
HEADER1=('00256AR50 ',
'11004CMS ',
DATENS=(MD4),[/color]TIMENS=(24)),
INCLUDE=(92,3,CH,EQ,C'750'),
TRAILER1=('00256AR59 ',
'11004CMS ',
COUNT=(M11,LENGTH=10),
TOT=(157,20,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-)))
/*

in this DATENS should have value YYYYDDD date format.
can you please help on this.

Re: print julian date in header using sort

PostPosted: Thu Feb 23, 2012 3:13 pm
by bodatrinadh
Replace DATENS=(MD4) with &YDDDNS=(4D)).

Thanks
-3nadh