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: 2177
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 Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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