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
 

 

Select a series of records for matching condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Thu Feb 20, 2014 12:36 pm    Post subject: Select a series of records for matching condition
Reply with quote

Hi all,

My input file has record types from 1A to 9A(in column postion of 60). My requirement is if the 1A(2bytes) record type is found with 722(in column postion 70), then i have to copy/select this set of records from 1A to 9A to output file.

If this condition of 1A with 722 in columns of 60,70 are not met, then i have to skip the set of 1A-9A records until next matching is found.
Once found again i have to copy/select the set of matched records.

Record Length - 293, Fixed
If you share idea it would be appreciated !!
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Thu Feb 20, 2014 12:51 pm    Post subject: Reply to: Select a series of records for matching condition
Reply with quote

INREC IFTHEN=(WHEN=GROUP with BEGIN for 1A and END for 9A, PUSH the value you want to test after the end of the record (PUSH=(294:70,3) the use OUTFIL INCLUDED= with BUILD to return the records to their normal size.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Feb 20, 2014 12:53 pm    Post subject:
Reply with quote

Quote:
then i have to copy/select this set of records from 1A to 9A to output file
.

Cannot understand this

Try IFTHEN=(WHEN= and overlay
Back to top
View user's profile Send private message
ezhavendhan

New User


Joined: 27 Mar 2013
Posts: 11
Location: India

PostPosted: Fri Feb 21, 2014 3:12 pm    Post subject: Reply to: Select a series of records for matching condition
Reply with quote

Thank you Bill, it worked out !!!

Here it is,
Code:


OPTION COPY                                           
    INREC IFTHEN=(WHEN=GROUP,                         
    BEGIN=(60,2,CH,EQ,C'1A',AND,70,3,CH,EQ,C'722'),   
    END=(60,2,CH,EQ,C'9A'),                           
    PUSH=(294:ID=1))                                   
OUTFIL INCLUDE=(294,1,CH,NE,C' '),BUILD=(1,293)       



Enlight more on what do ID in the push signifies ?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7235

PostPosted: Fri Feb 21, 2014 4:56 pm    Post subject: Reply to: Select a series of records for matching condition
Reply with quote

I was thinking you'd come up with a pretty good solution. Then I saw your last line, so you did some good, but not complete, researching :-)

The ID= is the sequential number allocated to all the groups, ID=1 is a one-digit field for this sequence. You only have one group, so one digit is fine. If you had five groups, all the records in the first group would get an one-byte field of value "1", all the second "2", then "3" through to five for the three remaining groups.

With a small number of values defining the group, the AND on the BEGIN is a good idea.

Code:
OUTFIL INCLUDE=(294,1,CH,NE,C' '),BUILD=(1,293)


This is a bit tortuous to read. You could instead OMIT= records whose value is blank or INCLUDE= those with C'1' (now that you know what the ID does).
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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