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


     
 
MAINFRAME - TIP OF THE DAY : All available storage is assigned to the job or jobstep, If REGION is coded 0K or 0M

Google
 
Web mainframegurukul.com

make a output file from two input files on certain condition

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
vikash58
Member


Joined: 30 Oct 2007
Posts: 3
Location: Pune

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

PostPosted: Wed Dec 31, 2008 5:00 pm    Post subject: make a output file from two input files on certain condition Reply with quote

Hi All,

I have two input file and I want a output file as below:

1st Input:

XXXX 1234 HGKKJKKJGJ.......
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......

here col 6-9 is key.

2nd Input:
AAAA 7347 A H 32.....
AAAA 1234 B G 54.....
AAAA 6456 C D 76.....

here also 6-9 is key.

I want the output file in the format of 1st input file excluding the duplicate keys. Means if the key is present in 2nd file don't write the record for this key.

Output expected as
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......
_________________
Vikash kumar
09922611854
Back to top
View user's profile Send private message Send e-mail
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: Wed Dec 31, 2008 9:39 pm    Post subject: Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD *
XXXX 1234 HGKKJKKJGJ.......
XXXX 2424 BGYUOJLLKH.......
XXXX 8474 YFTFFJYGIKLJ......
/*
//IN2 DD *
AAAA 7347 A H 32.....
AAAA 1234 B G 54.....
AAAA 6456 C D 76.....
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(6,4,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
/*

_________________
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.
vikash58
Member


Joined: 30 Oct 2007
Posts: 3
Location: Pune

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

PostPosted: Fri Jan 02, 2009 10:50 am    Post subject: Reply with quote

Thanks for reply.

I want the output in a file, then what changes need to be done.
Also My file is not fixed of 80.
_________________
Vikash kumar
09922611854
Back to top
View user's profile Send private message Send e-mail
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
1 salutes

PostPosted: Fri Jan 02, 2009 8:19 pm    Post subject: Reply with quote

Quote:
I want the output in a file, then what changes need to be done.


Just change the //OUT DD statement to point to your output file. For example:

Code:

//OUT DD DSN=myfilename,DISP=(NEW,CATLG,DELETE),
//  SPACE=(CYL,(5,5)),UNIT=SYSDA


Quote:
Also My file is not fixed of 80


Am I supposed to read your mind to figure out the actual RECFM and LRECL of your file, or could you possibly, I don't know, TELL ME the actual RECFM and LRECL? Sheesh.

And please DON"T post the same question on multiple help boards!
_________________
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.
vikash58
Member


Joined: 30 Oct 2007
Posts: 3
Location: Pune

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

PostPosted: Tue Jan 06, 2009 11:24 am    Post subject: Reply with quote

Hi,

the Actual RECFM=FB and LRECL=600 for INP1 and
RECFM=FB and LRECL=900 for INP2.

Also,I need to seperate the control statement in some other member. And then use this member in our PROC or JCL.

So that I don't have to write the control statement in all JCLs or PROC. Just use the member.
_________________
Vikash kumar
09922611854
Back to top
View user's profile Send private message Send e-mail
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: Tue Jan 06, 2009 9:56 pm    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for using PDS members for the control statements. Just make sure that the PDS has RECFM=FB and LRECL=80.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/600)
//IN2 DD DSN=...  input file2 (FB/900)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/600)
//TOOLIN DD DSN=pds(M1),DISP=SHR
//CTL1CNTL DD DSN=pds(M2),DISP=SHR
//CTL2CNTL DD DSN=pds(M3),DISP=SHR
//CTL3CNTL DD DSN=pds(M4),DISP=SHR


pds(M1):

Code:

COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(6,4,CH) NODUPS USING(CTL3)


pds(M2):

Code:

  INREC OVERLAY=(601:C'1')


pds(M3):

Code:

  INREC BUILD=(1,600,601:C'2')


pds(M4):

Code:

  OUTFIL FNAMES=OUT,INCLUDE=(601,1,CH,EQ,C'1'),BUILD=(1,600)

_________________
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.
academyindia4
Guest





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

PostPosted: Mon Jan 25, 2016 10:35 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
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
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 Query For IEBPTPCH 3 padmajeet.gaikwad 13444 Mon Feb 01, 2016 10:56 pm
academyindia4 View latest post
No new posts Unable to achieve below scenario using ICETOOL 27 sirianangel 33681 Mon Feb 01, 2016 10:01 pm
academyindia4 View latest post
No new posts Need to put records a Sorting order as mentioned below. 14 Yash1911 12633 Mon Jan 25, 2016 9:50 pm
academyindia4 View latest post
No new posts how to deal with the below scenario using iebgener 7 mainframes_6002 11170 Wed Dec 07, 2011 10:34 am
DikDude View latest post
No new posts Coulu someone explain the parameters in the below code? 1 lovely sweety 11352 Thu Jun 09, 2011 3:50 pm
dbzTHEdinosauer 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-3691.html