|
View previous topic :: View next topic
|
| Author |
Message |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
I am including the records satisfying the condition in IFTHEN as in below attachment
Now I need to OMIT the rest of the records. How can I do that?
Please suggest.
TIA |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Please copy/paste code from your emulator, do not post images.
You just need to have an INCLUDE COND= for the conditions you have with the IFTHENs. |
|
| Back to top |
|
 |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
Sure Bill Woodger. Going forward I will copy as per your suggestion.
Thank you for your reply. Its working now.
Also in the BUILD, since I am using the code as
BUILD=(1:1,4,5:1214,18)
since my input is VB, and output is FB, so as no to miss the RDW.
My record is starting from 5th character and first 4 bytes are empty.
How can I get records which start from 1 and also should not miss RDW ?
TIA |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Code: |
| BUILD=(5,43) or BUILD=(5,39) |
When you CONVERT to fixed-length, you BUILD to the fixed-length you want to see on the output, but based on the variable-length of your input to the BUILD. Basically, adjust everything by four to ignore the RDW. Depending how you've calculated 43 already, that may not need to change. |
|
| Back to top |
|
 |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
Its working as per my expected result.
Thank you very much Mr. Bill.... |
|
| Back to top |
|
 |
tvinodkumar7
New User
Joined: 06 Jan 2015 Posts: 19 Location: Hyderabad, INDIA
|
|
|
|
Now as part of performance tuning,
since if I use OUTREC, we may require more memory for intermediate file.
Hence I planned to use the OUTFIL directly instead of OUTREC as below
| Code: |
SORT FIELDS=COPY
OUTFIL IFTHEN=(WHEN=((204,3,CH,EQ,C'010',OR,204,3,CH,EQ,C'019'),AND,
(206,7,FS,EQ,NUM)),
BUILD=(1:204,2,3:C'000000000',
12:206,7,19:39,05,PD,TO=ZD,LENGTH=09,
28:44,07)),
IFTHEN=(WHEN=(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'),
BUILD=(1:328,18,19:39,05,PD,TO=ZD,LENGTH=09,
28:44,07))
INCLUDE COND=((206,7,FS,EQ,NUM),OR,
(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019')) |
also my input file is 3025 and the required output should have 34 length.
If I give 3025 LRECL in the output file, it is successful, else I am getting the below error
| Code: |
| 3025 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 34 BYTE LRECL FOR SORTOUT |
Please suggest.
TIA.
Code'd |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
DFSORT is designed to do things quickly. There is no way that it correlates your INCLUDE to your processing, so it is unaware that every remaining input record has a BUILD processed for it. You need to use IFOUTLEN which sets the length of the record after the IFTHEN processing has finished.
In a COPY it is not going to make any difference for performance between the INREC, OUTREC and OUTFIL. I still use INREC to "cut it down early". Obviously the impact is when there is a SORT, as reducing the record size before the data is sorted, reduces the amount of data that is tossed around.
Don't specify any DCB information (RECFM or LRECL) on the DD for the output file(s). It means there are two places to maintain the data. SORT will set up everything correctly, which with your example would be the long value, but would change when you make the change to the Control Cards.
| Code: |
INCLUDE COND=((206,7,FS,EQ,NUM),OR,
(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'))
INREC IFOUTLEN=34,
IFTHEN=(WHEN=((204,3,CH,EQ,C'010',OR,204,3,CH,EQ,C'019'),AND,
(206,7,FS,EQ,NUM)),
BUILD=(1:204,2,3:C'000000000',
12:206,7,19:39,05,PD,TO=ZD,LENGTH=09,
28:44,07)),
IFTHEN=(WHEN=(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'),
BUILD=(1:328,18,19:39,05,PD,TO=ZD,LENGTH=09,
28:44,07))
SORT FIELDS=COPY |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|