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
 

 

SYNCSORT dynamically update of sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT dynamically update of sort card
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: 500
Location: USA

PostPosted: Tue Sep 16, 2008 10:41 pm    Post subject:
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    Post subject: Reply to: SYNCSORT dynamically update of sort card
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: 500
Location: USA

PostPosted: Fri Sep 19, 2008 8:18 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Sep 19, 2008 8:23 pm    Post subject:
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: 2276
Location: @my desk

PostPosted: Fri Sep 19, 2008 9:08 pm    Post subject:
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    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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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