Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2276
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us