Page 1 of 1

Generating dynamic sort card

PostPosted: Fri May 06, 2016 10:15 am
by creddy
can some one help me to create dymanic sort cord as below:
Include cond=((1,2,ch,eq,07),and,(19,9,ch,eq,c'xxxxx',or,19,9,ch,eq,c'yyyyyy') )

where XXXXXXXXX or YYYYYYYYY is dynamically used from inputfile.

How is this used ((1,1,BI,NE,1,1,BI),OR,') from site example , cant we ignore this in sort card creation ? Please can some one share any more examples?

//SYSIN DD *                                                            
  OPTION COPY                                                          
  OUTFIL REMOVECC,                                                      
    HEADER1=('  SORT FIELDS=(4,4,PD,A) ',/,                                  
      '  INCLUDE COND=((1,1,BI,NE,1,1,BI),OR,'),                        
    BUILD=(C'   (4,4,PD,EQ,',1,7,C',AND,244,1,CH,EQ,C''',8,1,C'''),OR, *
                 ',80:X),                                              
    TRAILER1=('    (1,1,BI,NE,1,1,BI))')                                
/*

Re: Generating dynamic sort card

PostPosted: Fri May 06, 2016 12:38 pm
by enrico-sorichetti
When You have a question, START a new topic,
Do not tailgate to another topic even if the problem is the same

topic split.

Re: Generating dynamic sort card

PostPosted: Fri May 06, 2016 3:42 pm
by NicC
Please use the code tags when presenting code, JCL, control cards etc - basically anything that you would see on you screen. It makes your posty more understandable.

Re: Generating dynamic sort card

PostPosted: Sat May 07, 2016 1:11 am
by BillyBoyo
The best way to do this is a two-step approach. In the first step generate sort symbols for the data on your second file. In the second step, use the sort symbols on a SYMNAMES DD and reference the symbols in the INCLUDE COND or wherever.

There are examples here.

If there are a variable number of items on your second file, instead generate the INCLUDE itself.