IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Input Last Two Year Records from a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Tue Mar 03, 2009 6:58 pm
Reply with quote

Hi ,
I need to include the last two year Recods only from the Input History file.

Input :

Data1 09 (Year is 2009)
Data2 01 (Year is 2001)
Data3 08 (Year is 2008)
Data4 89 (Year is 1989)
Data5 98 (Year is 1998)
Data6 07 (Year is 2007)

Output :

Data1 09
Data3 08
Data6 07

Thanks in advance.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 03, 2009 7:09 pm
Reply with quote

Moved to correct forum for SYNCSORT questions

What have you read about in the product manuals for INCLUDE or OMIT ?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Mar 03, 2009 11:12 pm
Reply with quote

Hello Raghuraman,

This SyncSort for z/OS 1.3 job should produce your requested output:

Code:

//SORT1 EXEC PGM=SORT,PARM='CENTWIN=80'           
//SORTIN  DD *                                     
DATA1 09                                         
DATA2 01                                         
DATA3 08                                         
DATA4 89                                         
DATA5 98                                         
DATA6 07                                         
//SORTOUT DD DSN=output.file,...
//SYSOUT  DD SYSOUT=*                             
//SYSIN   DD *                                     
 INREC OVERLAY=(10:&DATE3-720)                   
 SORT FIELDS=COPY                           
 OUTFIL INCLUDE=(7,2,Y2C,GE,12,2,Y2C),BUILD=(1,8)
/*     


Regards,
Back to top
View user's profile Send private message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Thu Mar 05, 2009 5:09 pm
Reply with quote

Hi ,
Thanks for your immediate response.I tried that code it says "INREC Syntax Error" for the Statement. "INREC OVERLAY=(10:&DATE3-720)".
We are having Syncsort V1.2 only . Could any one provide code compatible for V1.2?

Thanks in Advance.
icon_wink.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Mar 05, 2009 6:48 pm
Reply with quote

Raghuram,

Change the control statements in the above job like this and rerun your job. It works with my 1.2 version.
Code:
//SYSIN    DD *                                             
 INREC OVERLAY=(10:&DATE3,12,2,Y2C,SUB,7,2,Y2C,M11,LENGTH=5)
 SORT FIELDS=COPY                                           
 OUTFIL INCLUDE=(17,5,ZD,LE,2),BUILD=(1,8)                 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top