Unusual INCLUDE



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

Unusual INCLUDE

Postby JohnH » Fri Aug 03, 2012 12:38 am

I need to sort a VSAM file and include only those records in the output which contain a 'Y' in column 1 and MMYY in the next four columns where MMYY is the two-digit month and two-digit year of the previous month. Example: in Autust of 2012 'Y0712...' would be selected, but 'y0812...' would not. Any help appreciated. John
JohnH
 
Posts: 8
Joined: Wed May 27, 2009 7:22 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Unusual INCLUDE

 

Re: Unusual INCLUDE

Postby dick scherrer » Fri Aug 03, 2012 2:00 am

Hello,

You could consider generating a SYMNAMES statement containing the MMYY you want and usint this in the INCLUDE (along with the Y in col 1.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Unusual INCLUDE

Postby bodatrinadh » Fri Aug 03, 2012 4:40 pm

Hello johnH,

You can try below code..

//STEP1A    EXEC PGM=SORT                                 
//SYSPRINT DD SYSOUT=*                                     
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
Y0812 AA1                                                 
 0412 AA2                                                 
 0712 AAC                                                 
Y0212 AA3                                                 
Y0712 AAA                                                 
 0112 AA4                                                 
 0612 BB1                                                 
//SORTOUT  DD SYSOUT=*                                     
  INREC BUILD=(01,10,81:04,02,83:02,02)                   
  SORT FIELDS=COPY                                         
  OUTFIL OUTREC=(1,10),INCLUDE=(1,1,CH,EQ,C'Y',AND,       
                                81,4,Y2T,EQ,Y'DATE2'-1)   


Output will be :-

Y0712 AAA
Thanks
-3nadh
User avatar
bodatrinadh
 
Posts: 67
Joined: Thu Jan 12, 2012 9:05 pm
Has thanked: 0 time
Been thanked: 4 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post