I have a filter file(CSV) that carries the following data as below
(Header is just for understanding the layout, will not be present in the actual file)
Code:
Header - no. of recs,Value1,Value2,Value3,startpos,length
100,abc,pqr,xyz,21,3
50,werw,rmdw,poiu,24,4
100,a,b,c,28,1
In the above file I got 3 filters based on which I have to generate the sort cards.
I did below which is applicable when the filter file have only one record.
Code:
INCLUDE COND=(21,3,CH,EQ,C'abc'),OR,
(21,3,CH,EQ,C'pqr'),OR,
(21,3,CH,EQ,C'xyz')
OPTION VLSHRT
SORT FIELDS=COPY,STOPAFT=100
OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(1:10,11)
Is there a way to generate a single sortcard even if the filter file has multiple records as above?
Note: I use REXX to convert the filter file in to a sort card.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Did you stick that through EXEC PGM=SORT?
Have you looked at field-type SS?
You'll have to explain what you want with your 100 and 50. Are the values mutually exclusive across your data? Or could some of the 50 and the second 100 be included within the first 100, etc?
You'll have to explain what you want with your 100 and 50. Are the values mutually exclusive across your data? Or could some of the 50 and the second 100 be included within the first 100, etc?
They are mutually exclusive. Thats the reason each filter record have their own record limit.
Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
Try something like:
Code:
INCLUDE COND=(21,3,SS,EQ,C'abc,pqr,xyz',OR
24,3,SS,EQ,C'werw,rmdw,poiu',OR,
28,1,SS,EQ,C'a,b,c')
SORT etc.
This is called a SUBSTRING function. In the reference manual go to the section for the INCLUDE statement and look for the "Substring Comparision" test.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Correct, Dave. The SS just simplifies the test.
KarthickPearl, if you want to do multiple selections in one shot, you're going to have to code for it. You can limit the records on OUTFIL. You may even find multiple OUTFILs more convenient.
I think you have to describe more of what you are trying to do.