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

SORT Query with the next record


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

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Sat Mar 09, 2013 12:56 am
Reply with quote

Thanks Bill for helping. changing the program is very tough task which we faced yesterday in terms of approval. Promote the code to different levels in changeman and then asking for approval which really takes time. this solution will definetly be used for future abends.
Thanks again.
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: Sat Mar 09, 2013 1:59 am
Reply with quote

Thanks for letting us know.

I think it is better to get to the root of the problem with the data, rather than just having something handy as a permanent thing. If you're "coping" with one "problem" it can often "hide" something else, until the point it "bites" you, big time.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Mon Mar 11, 2013 9:21 pm
Reply with quote

Hi Bill,
Thanks for your suggestion. The problem happened because frontend did some reboot and after the first reboot the first file sent will always have the date and time issue.

apparently I have one more doubt with the when=group. Now the date and time is resolved. It will be in the same pair whenever the indicator is 1 as mentioned earlier.But in the same file I have one more issue.
there is a field at column 94-98 which is called type of transaction and they will be always in group.
like
1111
2222
1111
2222
1111
2222
so, 1111 will be always paired with 2222 and 3333 will be always paired with 4444 but i got the file with below case
1111
2222
1111
5555
1111
2222
1111
6666
1111
2222
so, i need to find out the records which didnt satisfied the above criteria
o/p will be
1111
5555
1111
6666
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Mar 12, 2013 1:38 am
Reply with quote

abhijit.nayak01 wrote:

apparently I have one more doubt with the when=group. Now the date and time is resolved. It will be in the same pair whenever the indicator is 1 as mentioned earlier.But in the same file I have one more issue.
there is a field at column 94-98 which is called type of transaction and they will be always in group.



If you had understood Bill's sample job it is quite easy to add the new requirement. Previously you pushed the date , now push the 1111 on to the next record and compare it using INCLUDE. It is a simple one and yet you want the complete control cards. Try to understand the control cards given to you and learn and then apply the same logic to other jobs.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Wed Mar 13, 2013 1:04 pm
Reply with quote

Hi Bill,

I tried the below sort card but its not dropping the records:
Code:
 OPTION COPY                                           
  INREC  IFTHEN=(WHEN=INIT,                           
         BUILD=(1,4,10X,5)),                           
        IFTHEN=(WHEN=GROUP,BEGIN=(113,4,CH,EQ,C'1111'),
               END=(113,4,CH,NE,C'2222'),             
            PUSH=(5:37,10))                           
  OUTFIL OMIT=(113,4,SS,EQ,C'1111,2222'),             
         BUILD=(1,4,15)                               



Please suggest.
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: Wed Mar 13, 2013 2:47 pm
Reply with quote

Well, you've PUSHed some data, but you don't use it for anything.


Code:
1111
2222


If that is your "pair", you will now have both pieces of information on the same second record, so can compare them.

Code:
1111
1111 2222


It might be an idea to set out, as a new, separate, question with a link to this one, exactly what you want to do specifically with this particular requirement.
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 Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top