Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

SORT card needed to exclude record set
Goto page 1, 2  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 09, 2015 8:09 pm    Post subject: SORT card needed to exclude record set Reply with quote

Here is how my input records look like -

A1 00 ABC XYZ -> header
A2 10 XXX PQR -> detail record 1
A3 20 GHI STU -> detail record 2
A4 99 KKK RRR -> trailer

I want to check whenever we have XXX at this position, then I would want to exclude the entire record set (i.e. all rows from 00 (header) to 99 (trailer).
Please suggest SORT card for the same
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 09, 2015 11:23 pm    Post subject: Reply with quote

JOINKEYS with the same dataset for both inputs. Specofy the key as the first byte (ie will be A) and use a JOIN UNPAIRED,F1,ONLY

In JNF2CNTL, INCLUDE for that value at that position and also a data-record.

If there are no records to include, your entire main file will be "unmatched", meaning you want it. If matched, meaning you don't want it, you won't get any output from the JOINKEYS.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
chaat
Member


Joined: 18 Apr 2010
Posts: 19
Location: St. Cloud, Minnesota, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 10, 2015 10:52 am    Post subject: Reply with quote

William Collins wrote:
JOINKEYS with the same dataset for both inputs. Specofy the key as the first byte (ie will be A) and use a JOIN UNPAIRED,F1,ONLY

In JNF2CNTL, INCLUDE for that value at that position and also a data-record.

If there are no records to include, your entire main file will be "unmatched", meaning you want it. If matched, meaning you don't want it, you won't get any output from the JOINKEYS.
this would be very easy with File-Aid MVS.

reply here if your interested.
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 10, 2015 12:32 pm    Post subject: Reply with quote

Always interested Smile
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Nov 12, 2015 12:59 am    Post subject: Reply with quote

Bill,

I tried the one suggested by you, it didn't work.

Here is my requirement -
input file -

Code:

B2 00 GGG   MISC_ORDER                 
B2 10 001  C   
B2 20 001  C   
B2 99 GLO   20151027 163020 0000002     
B2 00 HHH   MISC_ORDER                 
B2 10 200  200 
B2 20 200  200 
B2 10 200  200 
B2 20 200  200 
B2 99 GLO   20151027 163020 0000008


output file should look like this -
Code:

B2 00 HHH   MISC_ORDER                 
B2 10 200  200 
B2 20 200  200 
B2 10 200  200 
B2 20 200  200 
B2 99 GLO   20151027 163020 0000008



So, whenever 200 is at 7th byte in input file, I want those records (along with header = 00 at 4th byte & trailer = 99 at 4th byte) in the o/p file.

Please assist
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Nov 12, 2015 2:01 am    Post subject: Reply with quote

Well, of course it doesn't work. You've changed the spec.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Nov 12, 2015 8:10 pm    Post subject: Reply with quote

So anything that you can suggest?
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 16, 2015 7:04 pm    Post subject: Reply with quote

So does this mean we can't do this thru a SORT? Sad
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 16, 2015 9:03 pm    Post subject: Reply with quote

It can be done with SORT.

Can you post the code you tried, please?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Nov 16, 2015 10:02 pm    Post subject: Reply with quote

I only know of how to extract detail records (which even every Mainframe newcomer can do).
But I have no clue of how to extract corresponding header & trailer record for those detail records all together.
Tried checking in SORT manuals but could not get anything.
Hence seeking experts' guidance here!
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Nov 17, 2015 11:40 pm    Post subject: Reply with quote

Bill,

I tried to check sort manuals.
I felt that we can achieve this by any of this -

DATASORT operator of ICETOOL,
SUBSET operator of ICETOOL
IFTHEN WHEN=GROUP

However, I don't know what/how to do it precisely. Sad
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 18, 2015 4:41 am    Post subject: Reply with quote

You use JOINKEYS, with the same dataset for both inputs.

In JNF1CNTL, you use INREC with WHEN=GROUP to PUSH an ID to a temporary extension to the record. This ID field will be your key for the first JOINKEYS statement, where you also specify SORTED,NOSEQCK.

In JNF2CNTL you using INCLUDE to identify the data that you want, and also to include all headers. Use WHEN=GROUP to do the same thing as in JNF1CNTL. Use IFTHEN=(WHEN=(logicalexpression) to identify the headers, and to set the extended ID to, for instance, binary zero. Use SUM FIELDS=NONE to avoid duplicate keys. Specify the extended ID as the second JOINKEYS key.

Don't use a JOIN statement, so you only get the matched records.

Specify your entire F1 only on the REFORMAT statement.

You should be around about there, then.

You can deal with duplicate keys in a different way. If you have many, many groups of records you may want to do it differently.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 18, 2015 7:59 am    Post subject: Reply with quote

I appreciate your effort/help Bill.
But would be lot better if you could also give the actual sort card (even if its not the final polished sort card that's ok).
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 18, 2015 12:16 pm    Post subject: Reply with quote

Well, I was hoping you'd show the one that you declared as "not working" so we could polish that one.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
goldyroshan
Active Member


Joined: 05 Apr 2012
Posts: 67
Location: WI, USA

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Nov 20, 2015 9:22 pm    Post subject: Reply with quote

Okay.
I'll try this one out & get back with the results.
Thanks a lot
_________________
Logically yours,
Smile GRS Smile
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Goto page 1, 2  Next
Page 1 of 2



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7961.html