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
 

 

Building Sort Card dynamically using Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 59
Location: hyderabad

PostPosted: Sat Nov 15, 2014 6:08 pm    Post subject: Building Sort Card dynamically using Syncsort
Reply with quote

Hi all,
I want to build control card like below dynamically depending on the input values
Code:

SORT FIELDS=COPY                                         
OUTFIL FILES=01,                                         
INCLUDE=(102,4,CH,EQ,C'WWWW',OR,102,4,CH,EQ,C'NNNN',OR,102,4,CH,EQ,C'RRRR')
         102,4,CH,EQ,C'SSSS'.....)


The values WWWW, NNNN,RRRR will be coming from input file.
Point here is the number of input records may vary. It can be 1 or 2 or 3...10..
I am using SYNCSORT FOR Z/OS 1.4.2.0R
Thanks in advance!
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sat Nov 15, 2014 10:58 pm    Post subject:
Reply with quote

Look at how to use JOINKEYS, It should give what you are trying to achieve...
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Sun Nov 16, 2014 4:53 am    Post subject: Reply to: Building Sort Card dynamically using Syncsort
Reply with quote

Unless the data is already in that order, a JOINKEYS solution would require a SORT of the data, and possibly a second SORT if the original order is required for the output. JOINKEYS would also require more memory, as there are three tasks.

rikdeb,

Why do you need the INCLUDE= on OUTFIL, why not INCLUDE COND=? Is it part of something else?

A simple solution would be to have the 10 values, but for any which are not required, set those to a value which is impossible: X'FFFFFFFFFF' for instance.

To make generation (and human reading) easier, regularize your cards:

Code:
 SORT FIELDS=COPY                                         
 OUTFIL FILES=01,                                         
 INCLUDE=(102,4,CH,EQ,C'WWW0',
       OR,102,4,CH,EQ,C'WWW1',
       OR,102,4,CH,EQ,C'WWW2',
       OR,102,4,CH,EQ,C'WWW3',
       OR,102,4,CH,EQ,C'WWW4',
       OR,102,4,CH,EQ,C'WWW5',
       OR,102,4,CH,EQ,C'WWW6',
       OR,102,4,CH,EQ,C'WWW7',
       OR,102,4,CH,EQ,C'WWW8',
       OR,102,4,CH,EQ,C'WWW9')


So that is what it could look like with 10 values.

The problem for generation is that you need three different types, first, middle and last. The first requires the INCLUDE=(, the middle ones are simple, and the last has a trailing bracket instead of the comma.

If your 10-record file can be like this:

Code:
FWWW0
MWWW1
MWWW2
LWWW3


Then generating the INCLUDE= is easy.

So, how much data, is it in the selection order, can the selection file be made like that, or do you have to work it out. Why INCLUDE= not INCLUDE COND=, and anything else you feel may be helpful.
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 59
Location: hyderabad

PostPosted: Sun Nov 23, 2014 3:57 pm    Post subject:
Reply with quote

Hi Bill.. sorry for the late reply.. I could find a way out using sas to build the contol card. Thanks for all ur help!!!!
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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