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


     
 
MAINFRAME - TIP OF THE DAY : Q. If there is a situation, where we need to code more than 255 steps in a JOB? A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.

Google
 
Web mainframegurukul.com

Programmers Voted for below topics.      Please Vote for good Posts. Votes Salutes
Topic Title Votes Salutes
SOC 7 abend - interview question 6
splitting of records using cobol 6
HOW TO FIND LINKAGE LENGTH 6
EJECT Verb in COBOL 5
jcl sort to add leading zeroes 5
Infosys Training Program for freshers 5
Changes in copybook 4
IKJ56500I COMMAND DSN NOT FOUND 3
Cobol Multiple Choice Questions By Shravan Wipro 3
Comparing two files 3
What are the issues related with correlated subqueries? 3
VSAM File status 23 ,but records are present in the file 3
what is index or subscript in cobol. please give me brief ex 3
What is the difference between SYNONYM and ALIAS? 1 1
PROCLIB 1 1
sort two files with same sort condition 1 1
What is the difference between Copy and Include? 1 1
EZtrv+ - Is there a way to suppress ez-code from printing... 1 1
Merging two files into one based on certain key fields: 1 1
what is index or subscript in cobol. please give me brief ex 1 1
Copy GDG to GDG (one to one). 1 1
Cobol Multiple Choice Questions By Shravan Wipro 1 1
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 1 1
jcl sort to add leading zeroes 5
VSAM File status 23 ,but records are present in the file 3
Urgent Help needed !! 3
Hexadecimal to decimal conversion - SORT JCL INREC OUTREC 3
How we can access PDS and its Members thru COBOL ? 3
stored procedure in cobol 2
VERTICAL ARRAY IN CICS 2
what s the difference between DB2 & ADB2? 2
What is auditing? 2
Reg DFSORT utility. 2
Computer based tutorial on IMS DB/DC 2
what is index or subscript in cobol. please give me brief ex 2
How to compare two ps files having millions of records ? 2
Cobol Multiple Choice Questions By Shravan Wipro 2
SOC 7 abend - interview question 2
How to read HEX file and convert it into decimal in REXX. 2
Various Locking mechanism for cursors and other SQL? 2
How to fetch and compare the system date in JCL 2
Comparing 2 files based on Acct number without using tables 1
JCL-I need to FTP from MF to Local computer 1
cics 1
sort two files with same sort condition 1
U4093 IMS Abend 1
writing 2 records for each qualifying input record. 1
Is it possible to get last modified date of PDS members... 1
Merging two files into one based on certain key fields: 1
How to run only 2 steps out of 100 steps??? 1
Corresponding statement 1
Difference between an Object Module and Load Module 1
Moving cursor to next field in ISPF dialog 1
DB2 query !! 1
JCL Interpreter :?: 1
Comparing Date with current date 1
SORT verb - help 1
How to assign System Date/Time to a parameter in a JCL pgm? 1
is the answer correct?? 1
Mainframe Developer Requirement - Coimbatore 1
Man of the year 1
I need to FTP from MF to UNIX 1
Control flow from one STEP to another 1
How to convert Julian date format into yyyymmdd date format? 1
What is the difference between Static and Dynamic Binding? 1
In jcl please help me. 1
Access DB2 region using rexx 1
DFHAC2016 - Trans XXXX cannot run because program XXX is Not 1
EZtrv+ - Is there a way to suppress ez-code from printing... 1
How to use XREF.. 1
DB2 checkpoint-restart doubts 1
JOIN UNPAIRED,F1,F2,ONLY

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
tirupathi rao
Member


Joined: 16 Feb 2012
Posts: 4

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

PostPosted: Fri Mar 23, 2012 6:40 pm    Post subject: JOIN UNPAIRED,F1,F2,ONLY Reply with quote

HI

I have two fiels say F1 & F2

In F1 i have some records of lemght 1 to 40,
In F2 also i have some records of lemght 1 to 40,

Now i want to join the upaired records from F1 and F2

My code is like

SORT FIELDS=COPY
JOINKEYS FILE=F1,FIELDS=(1,40,A)
JOINKEYS FILE=F2,FIELDS=(1,40,A)
REFORMAT FIELDS=(F1:1,40,F2:1,40)
JOIN UNPAIRED,F1,F2,ONLY
OUTFIL FILES=01,BUILD=(01:1,40)

I am getting the all the records from F1 But i am not getting F2 records.
in the F2 records place i am getting SPACES.


In F1

1------------------40
SAHSHI 32450
NAVEN 32560
DEEPAK 32586

In F2

1--------------------40
THIRU 32553
DINESH 35686


In O/P
***********************TOP*********************************
1------------------40
SAHSHI 32450
NAVEN 32560
DEEPAK 32586

SPACES
***********************BOTTOM******************************

plz help me out to get the proper O/P.
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.

dbzTHEdinosauer
Moderator


Joined: 02 Oct 2006
Posts: 954

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

PostPosted: Fri Mar 23, 2012 7:48 pm    Post subject: Reply with quote

REFORMAT FIELDS=(F1:1,40,F2:1,40)

40 + 40 = 80


OUTFIL FILES=01,BUILD=(01:1,40)

40 = 40
_________________
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
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.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

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

PostPosted: Fri Mar 23, 2012 11:13 pm    Post subject: Reply with quote

Quote:
plz help me out to get the proper O/P.


Well, we probably could if we knew what you meant by the proper o/p.

Quote:
Now i want to join the upaired records from F1 and F2


This makes no sense. You can "join" paired records, but how can you join "unpaired records"? If I have AAA,BBB,CCC,EEEE in file1 and AAA,CCC,DDD,FFF in file2, I can join the paired records (AAA, CCC) on the key. But how can I join the unpaired records (BBB and EEE in file1, DDD and FFF in file2) - join which unpaired records in file1 to which unpaired records in file2?

Do you actually mean that you just want to keep the F1 records that don't have a match in F2, and keep the F2 records that don't have a match in F1? In your example, that would be ALL of the records since none of them match. A good example would show matching and unmatching records for F1 and F2 and the expected output.

If so, the correct control statements would be:

Code:

  JOINKEYS FILE=F1,FIELDS=(1,40,A)           
  JOINKEYS FILE=F2,FIELDS=(1,40,A)           
  JOIN UNPAIRED,F1,F2,ONLY                   
  OPTION COPY   
  OUTFIL VTOF,BUILD=(5,40)                           


If that's not what you want to do, then you need to do a better job of explaining what you want to do exactly. Show an example of your input records and expected output records for all possible cases.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort


Last edited by Frank Yaeger on Mon Mar 26, 2012 10:54 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
tirupathi rao
Member


Joined: 16 Feb 2012
Posts: 4

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

PostPosted: Sat Mar 24, 2012 12:39 pm    Post subject: Reply with quote

HI Yaeger

i am sorry for the confusion,

In my F1 i have records like

********************************* Top of Data ********************
1---------------------------------40
EZP005 EZ0005 Y
EZP022 EZ0021 Y
EZP022 EZ0021 Y
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP770 EZ0143 Y
EZP770 EZ0143 Y
EZP163 EZ0170 Y
EZP220 EZ0220 Y
EZP194 EZ0250 Y
******************************** Bottom of Data *****************

In my F2 i have records like

********************************* Top of Data ********************
1----------------------------------40
EZP190 EZ0008 N
EZP200 EZ0205 N
EZP271 EZ0303 N
EZP273 EZ0304 N
EZP058 EZ1313A N
******************************** Bottom of Data *****************

There is no any matched records in F1 & F2 i know that(Bcz in 40 positon Y is there in F1 and N is there in F2)

Now i need to get all the records form F1 and F2. But i am getting only F1 Records not getting F2 records the OUTPUT which is iam getting is

********************************* Top of Data ********************
EZP005 EZ0005 Y
EZP022 EZ0021 Y
EZP022 EZ0021 Y
SPACESSSSSSSSSSSS
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP116 EZ0115 Y
EZP141 EZ0358 Y
EZP141 EZ0358 Y
EZP141 EZ0358 Y
EZP141 EZ0358 Y
EZP163 EZ0170 Y
SPACESSSSSSSSSSSSSS
EZP194 EZ0250 Y

These are only F1 records in place of F2 records i am getting SPACES.....
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.
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 812
Location: San Jose, CA

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

PostPosted: Mon Mar 26, 2012 10:57 pm    Post subject: Reply with quote

You didn't show the output you actually want, so I can only guess what that would be. My guess is that a DFSORT job like the following would do what you want:

Code:

//S1 EXEC PGM=SORT                                               
//SYSOUT DD SYSOUT=*                                             
//SORTJNF1 DD DSN=...  input file (FB/40)             
//SORTJNF2 DD DSN=...  input file (FB/40)                           
//SORTOUT DD DSN=...  output file (FB/40)
//SYSIN DD *                                                     
  JOINKEYS FILE=F1,FIELDS=(1,40,A)                               
  JOINKEYS FILE=F2,FIELDS=(1,40,A)                               
  JOIN UNPAIRED,F1,F2,ONLY                                       
  OPTION COPY                                                     
  OUTFIL VTOF,BUILD=(5,40)                                       


For your input example, SORTOUT would have these records:

Code:

EZP005            EZ0005               Y     
EZP022            EZ0021               Y     
EZP022            EZ0021               Y     
EZP058            EZ1313A              N     
EZP116            EZ0115               Y     
EZP116            EZ0115               Y     
EZP116            EZ0115               Y     
EZP116            EZ0115               Y     
EZP163            EZ0170               Y     
EZP190            EZ0008               N     
EZP194            EZ0250               Y     
EZP200            EZ0205               N     
EZP220            EZ0220               Y     
EZP271            EZ0303               N     
EZP273            EZ0304               N     
EZP770            EZ0143               Y     
EZP770            EZ0143               Y     


If that's not what you want for output, then you need to show exactly what you do want for output.
_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
manikandesvaran
Member


Joined: 03 Apr 2013
Posts: 5

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

PostPosted: Wed Apr 03, 2013 10:36 pm    Post subject: Getting error message while using Jointkeys Reply with quote

Hi Frank,

am just using the below joinkey function

//IN1 DD DSN=FILE,DISP=SHR
//IN2 DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=OUT,DISP=SHR
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,8,A)
JOINKEYS F2=IN2,FIELDS=(5,8,A)
JOIN UNPAIRED F1,F2
SORT FIELDS=COPY
/*


am getting error message as ICE404A 0 REFORMAT STATEMENT WAS REQUIRED, BUT NOT FOUND

If JOIN is speciified the REFORMAT filed is optional only.But still getting the error.

Could you please clarify ?
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.
NicC
Active Member


Joined: 24 Jul 2011
Posts: 641
Location: Down on the pig farm

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

PostPosted: Wed Apr 03, 2013 11:56 pm    Post subject: Reply with quote

Please do not tailgate old topics. Do not address posts to a particular person. You can wait a long time for Frank to answer as he retired months ago and no longer contributes to the forums. Do post in the correct part of the forum - you have a sort query - what is wrong with posting in the sort part of the forum? Finally, welcome to the forum.
_________________
Regards
Nic
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: 529

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

PostPosted: Thu Apr 04, 2013 2:58 am    Post subject: Reply with quote

It is optional, but it is not your option whether or not to use it when necessary. You can always use it, there are cases where you don't need to, which is not your case. Use it.
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.
manikandesvaran
Member


Joined: 03 Apr 2013
Posts: 5

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

PostPosted: Thu Apr 04, 2013 2:04 pm    Post subject: Reply with quote

NicC wrote:
Please do not tailgate old topics. Do not address posts to a particular person. You can wait a long time for Frank to answer as he retired months ago and no longer contributes to the forums. Do post in the correct part of the forum - you have a sort query - what is wrong with posting in the sort part of the forum? Finally, welcome to the forum.


Apologies for the mistake.Being a new person in this forum i am not sure about the rules.

Thanks for your kind.
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

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

PostPosted: Fri Apr 05, 2013 1:23 pm    Post subject: Re: Getting error message while using Jointkeys Reply with quote

manikandesvaran wrote:
If JOIN is speciified the REFORMAT filed is optional only.But still getting the error.
That's not ture. The REFORMAT control statement is normally required if JOINKEYS is specified. It is optional if a JOIN control statement with the ONLY option has been specified in a join application since no records will actually be joined. So, as per your control statements, you'd need a REFORMAT as William has also said.
_________________
Regards,
Anuj
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.
manikandesvaran
Member


Joined: 03 Apr 2013
Posts: 5

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

PostPosted: Tue Apr 09, 2013 5:58 pm    Post subject: Re: Getting error message while using Jointkeys Reply with quote

Anuj Dhawan wrote:
manikandesvaran wrote:
If JOIN is speciified the REFORMAT filed is optional only.But still getting the error.
That's not ture. The REFORMAT control statement is normally required if JOINKEYS is specified. It is optional if a JOIN control statement with the ONLY option has been specified in a join application since no records will actually be joined. So, as per your control statements, you'd need a REFORMAT as William has also said.


Many thanks Anuj For the clarification.It was clear now for me.
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.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1631
Location: Mumbai, India

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

PostPosted: Wed Apr 10, 2013 2:48 pm    Post subject: Reply with quote

You're welcome.
_________________
Regards,
Anuj
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.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL All times are GMT + 5 Hours
Page 1 of 1



 
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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Getting no of records in a file 11 Rajapriyaa 10231 Tue Jun 19, 2012 7:33 pm
DikDude View latest post
No new posts Easytrieve program for getting Recound counts. 1 prakash.subramaniam 5353 Mon Oct 05, 2009 5:09 pm
Natarajan View latest post
No new posts Getting Error while using ICEMAN tool 4 giri211 9722 Mon Aug 31, 2009 3:59 pm
giri211 View latest post
No new posts Replacing characters Using JCL 5 rachitsethcse 10916 Thu Jul 23, 2009 9:46 pm
Frank Yaeger View latest post
No new posts Calling COBOL from C - getting SOC1 0 balajiiinx 6930 Tue Sep 23, 2008 10:25 am
balajiiinx View latest post
 





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-6374.html