Include And Outrec in Sort



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Include And Outrec in Sort

Postby k singh » Thu Feb 02, 2017 8:05 pm

Hi

I need a little help regarding include and outrec in sort.

R_code  Key1    key2      code1 Value1  code2   value2.............code100  value100
XX      aa      01      10      1.01    11      1.1                 0       0
YY      bb      01      20      3.2     10      6.8                 0       0      
XX      cc      02      0       0       40      4.5                 10      9.8
 

This is my input file. My file has keys and 100 code values(label values) and each parameter is of 10 length, total length is 2030
I need to create an output showing rows where r_code=XX and the corresponding value(N) when code(N) is equal to 10.

Output should be like this
aa~01~1.01
cc~02~9.8

BUt this gives me an error "INCLUDE/OMIT FIELD BEYOND RECORD"
I do understand that OUTREC is executed first and when Include needs to be executed its not able to find.
Any help on how to solve this

INCLUDE COND=(1,10,ch,EQ,C'XX',AND,(31,10,BI,EQ,10,OR,
51,10,BI,EQ,10,OR,71,10,BI,EQ,10,OR,91,10,BI,EQ,10,OR,
111,10,BI,EQ,10,or,131,10,BI,EQ,10,or,
.............................
2011,10,BI,EQ,10))
OPTION COPY
OUTREC IFTHEN=(WHEN=(31,10,BI,EQ,10),
BUILD=(11,10,C'~',21,10,C'~',41,10)),
IFTHEN=(WHEN=(51,10,BI,EQ,10),
BUILD=(11,10,C'~',21,10,C'~',61,10)),
IFTHEN=(WHEN=(71,10,BI,EQ,10),
BUILD=(11,10,C'~',21,10,C'~',81,10)),
...................................
IFTHEN=(WHEN=(2011,10,BI,EQ,10),
BUILD=(11,10,C'~',21,10,C'~',2021,10))
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: Include And Outrec in Sort

Postby k singh » Fri Feb 03, 2017 1:30 am

Hi All
I was able to find the issue. Its VB file so some of the records were smaller so that include statement. wrote another job to get rid of smaller record. the above logic worked fine. thanks a lot for your help
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: Include And Outrec in Sort

Postby willy jensen » Fri Feb 03, 2017 2:43 pm

perhaps OPTION VLSCMP,VLSHRT would help?
willy jensen
 
Posts: 465
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post