IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

VB file sort with one condition after another


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahul_jot

New User


Joined: 17 Aug 2005
Posts: 22
Location: Pune

PostPosted: Fri Mar 07, 2014 10:27 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 12:39 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 7:45 pm
Reply with quote

Hello,

I believe you need to tell SORT that there may be short records . . .
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 7:56 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 8:01 pm
Reply with quote

Thanks Bill!

Keep me straight . . . icon_cool.gif

d
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 07, 2014 11:06 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 07, 2014 11:24 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Mar 08, 2014 1:07 am
Reply with quote

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
View user's profile Send private message
rahul_jot

New User


Joined: 17 Aug 2005
Posts: 22
Location: Pune

PostPosted: Sat Mar 08, 2014 9:59 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sun Mar 09, 2014 12:09 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top