Search code examples
mainframesyncsort

Passing input for COND through a file


We usually pass condition parameters in Syncsort directly through inline in SYSIN:

//SYSIN DD *

 INCLUDE COND=(1,9,CH,EQ,C'000000000')

/*

For dynamic usage we could pass the parameters using "JPn" statements:

// SET XDSN=000000000
//STEP EXEC PGM=SYNCSORT, PARM='JP1"&XDSN"'

..... 

//SYSIN DD *

 INCLUDE COND=(1,9,CH,EQ,JP1)

/*

But could we pass the input for "conditional statements" through a file?


Solution

  • No.

    I'm hoping but not necessarily expecting that you have a dataset name for SYSIN in Production.

    There are a couple of approaches available, depending on the exact task.

    Firstly, you can generate the control cards. Each time your dynamic selection changes, you re-generate the control cards. If the selection data can change by actions you don't know about in advance, you can even generate the control cards immediately before using them.

    Secondly, you can look at using JOINKEYS.

    For up to 10 items, your JPn approach is fine. You could even specify multiple selections per JPn (using an SS data-type for a Sub-String search in place of the CH).

    If you know you are going to need more than can be reasonably expressed/maintained by the JPn solution, but you don't have a massive amount of selections, generate the control cards.

    If you have a massive number of selection items, then use JOINKEYS.