View previous topic :: View next topic
|
Author |
Message |
rahul_jot
New User
Joined: 17 Aug 2005 Posts: 22 Location: Pune
|
|
|
|
Hi,
I have a VB file with LRECL as 200. It has 3 different types of records with different lengths. 1st type of records are identified by char X'01' at position 20, 2nd with X'02' at position 20 and third with X'03' at position 20. The length of first type of record is 30 chars while second is 80 chars.
I want to extract 2nd type of record where I have X'1234' at position 40. I tried using include cond with both conditions, but it is giving issue as 1st record is of only 30 chars. I tried using IFTHEN as well will multiple options, but it also did not help.
Can anyone please help with this? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
From what you describe, there should be no problem using INCLUDE, so post the full sysout of the step where you tried INCLUDE, please. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe you need to tell SORT that there may be short records . . . |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
As long as data-position beyond the end of a record is not used, you don't need to tell it about short records.
Code: |
AAB12345X
AAC12Y
INCLUDE COND=(3,1,CH,EQ,C'B',AND,9,1,CH,EQ,C'X') |
This will work, because the 9,1 will only ever be used if the 3,1 is B. The AND will not be tested until there is a B. As long as no B records can be short, there is no need to tell SORT there are short records. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thanks Bill!
Keep me straight . . .
d |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Bill Woodger wrote: |
As long as data-position beyond the end of a record is not used, you don't need to tell it about short records.
Code: |
AAB12345X
AAC12Y
INCLUDE COND=(3,1,CH,EQ,C'B',AND,9,1,CH,EQ,C'X') |
This will work, because the 9,1 will only ever be used if the 3,1 is B. The AND will not be tested until there is a B. As long as no B records can be short, there is no need to tell SORT there are short records. |
Bill,
You did not get an ICE218A message for that ? OP needs the option VLSCMP for his include/omit condition.
Code: |
//SYSIN DD *
OPTION COPY,VLSCMP
INCLUDE COND=(20,1,CH,EQ,X'02',AND,40,2,CH,EQ,X'1234')
//* |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, Kolusu. I do. Sorry Kolusu, sorry Dick.
Write out 100 times, what works with IFTHEN need bear no relation to INCLUDE. Get SORT to do it...
Need to break my fingers before typing at times. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Bill,
Quote: |
Need to break my fingers before typing at times. |
Unfortunately, this doesn't help - at least for me . . .
heh heh heh
d |
|
Back to top |
|
|
rahul_jot
New User
Joined: 17 Aug 2005 Posts: 22 Location: Pune
|
|
|
|
Thanks everyone for your inputs.
Unfortunately I do not have access to IBMMainframes from my work. So I posted the query from home and could not post the sysout details. I received some U0218 abend when I tried this.
I'll try VLSCMP option and test the code on Monday. I'll keep you posted |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Although you have not posted the messages from the failed run, you should realize that a U0nnn abend implies an ICEnnnA error message. Find that message in the DFSORT Messages and Codes manual and take the recommended action. |
|
Back to top |
|
|
|