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

SYNCSORT dynamically update of sort card


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

New User


Joined: 16 Oct 2007
Posts: 3
Location: Hyderabad,India

PostPosted: Tue Sep 16, 2008 6:50 pm
Reply with quote

I have sort a card where I am filtering data from 93 to 99 in present. Going forward, in year 2009, I need to fetch data from 93 to 2000. In 2010 it should be 93 to 2001, and so on.

My input file has a year fileds as 75,80,99,00 for 2000, 02 for 2002. i.e data are from 1975 to current 2008.

To fulfill my requirement, what is your advice?

1.any technique in syncsort where I can update a sort card dynamically
2.simple,write a COBOl program for same.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Sep 16, 2008 10:41 pm
Reply with quote

Here is a sample job that will produce the desired output. You will need to modify the fields to correspond to your actual data.
Code:

//SYSIN DD *                                           
   INREC FIELDS=(1,2,&DATE2-108)                         
   SORT FIELDS=COPY                                     
   INCLUDE COND=(1,2,Y2C,GE,93,AND,1,2,Y2C,LT,5,2,Y2C)   
   OUTREC FIELDS=(1,2)                                   
/*   


Using these input records:
Code:
75
77
79
81
90
93
94
96
97
99
00
01
05
08

The following output was produced:
Code:
93
94
96
97
99

Depending on your default value for CENTWIN, you may want to also code PARM='CENTWIN=80' on the EXEC card, just to be on the safe side.

Hope this helps.
Back to top
View user's profile Send private message
Sharad Kumar

New User


Joined: 16 Oct 2007
Posts: 3
Location: Hyderabad,India

PostPosted: Fri Sep 19, 2008 6:26 pm
Reply with quote

Very Very thanks for your reply.

I have some problem in my execution.Please describe some fileds in detail.Below is my explanation,please correct me,if I am wrong..


1,2 - columns in input file
Date is funtion but I didn't get you about &DATE2 logic
Also please explain COND=(1,2,Y2C,GE,93,AND,1,2,Y2C,LT,5,2,Y2C)
Thank you.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Sep 19, 2008 8:18 pm
Reply with quote

Sharad Kumar,

&DATE2-108 inserts the current system date and subtracts 108 months (9 years) as per your specifications. The format of this field is yyyymm.

INCLUDE COND=(1,2,Y2C,GE,93,AND,1,2,Y2C,LT,5,2,Y2C) says to include the records when field 1,2 in Y2C format (which is yy) is greater than or equal to 93, AND when this field is also less than field 5,2 which is the last 2 digits of the year portion we inserted via INREC.
For example, if we ran this job today, the &DATE2-108 field in the INREC statement would be processed as 199909. So if your data record was originally 93, then after INREC processing it would be 93199909 (Field 5,2 is 99).

Hope this helps. Let me know if you have any further questions.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Sep 19, 2008 8:23 pm
Reply with quote

Please note, support for &DATEx-n was included in SyncSort for z/OS 1.3. If you are attempting to run this job with an earlier release of the product, you will get the following error:
Code:
WER268A  INREC STATEMENT   : SYNTAX ERROR
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Sep 19, 2008 9:08 pm
Reply with quote

Sharad Kumar,

If you don't have the latest version installed, still you can achieve this using the below Syncsort job which works with my version which is SyncSort for z/OS 1.2.
Code:
//STEP1    EXEC PGM=SORT,PARM='CENTWIN=1975'
//SYSOUT   DD SYSOUT=*                     
//SORTOUT  DD SYSOUT=*                     
//SORTIN   DD *                             
75                                         
77                                         
79                                         
81                                         
90                                         
93                                         
94                                         
96                                         
97                                         
99                                         
00                                         
01                                         
05                                         
08                                         
//SYSIN DD *                               
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,2,&DATE2)),                   
        IFTHEN=(WHEN=INIT,BUILD=(1,8,5,2,Y2Z,SUB,1,2,Y2Z,TO=ZDF))
  SORT FIELDS=COPY                                               
  OUTFIL INCLUDE=(1,2,Y2Z,GE,93,AND,9,15,ZD,GE,9),BUILD=(1,2)   
/*   

SORTOUT
Code:
93
94
96
97
99

Thanks,
Arun
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top