Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Input Last Two Year Records from a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Input Last Two Year Records from a file
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 03, 2009 7:09 pm    Post subject:
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: 500
Location: USA

PostPosted: Tue Mar 03, 2009 11:12 pm    Post subject:
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    Post subject:
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: 2285
Location: @my desk

PostPosted: Thu Mar 05, 2009 6:48 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us