Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

VB file sort with one condition after another

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: VB file sort with one condition after another
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Mar 07, 2014 12:39 pm    Post subject: Reply to: VB file sort with one condition after another
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

Site Director


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

PostPosted: Fri Mar 07, 2014 7:45 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Mar 07, 2014 7:56 pm    Post subject: Reply to: VB file sort with one condition after another
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

Site Director


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

PostPosted: Fri Mar 07, 2014 8:01 pm    Post subject:
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    Post subject: Re: Reply to: VB file sort with one condition after another
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Mar 07, 2014 11:24 pm    Post subject: Reply to: VB file sort with one condition after another
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

Site Director


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

PostPosted: Sat Mar 08, 2014 1:07 am    Post subject:
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    Post subject: Reply to: VB file sort with one condition after another
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: 1738
Location: Bloomington, IL

PostPosted: Sun Mar 09, 2014 12:09 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us