MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to exact a record from one file based on the key of 2fl

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Fri Jul 13, 2007 11:00 am    Post subject: how to exact a record from one file based on the key of 2fl Reply with quote

I have 2 file A and B.

I have to take records from file B for all recods in file A(depending on hte key).

The key of file a is first A 10 bytes and the same filed in B file is 20-30.


can this be done thru DFsort or icetool or should i write a cobol logic only.

Thanks,
Aswin
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Fri Jul 13, 2007 11:12 am    Post subject: Reply with quote

Aswin,

Please search before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=5399

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Fri Jul 13, 2007 11:18 am    Post subject: Reply with quote

hi kolusu,

Thanks, Sorry for duplicate posting.


Aswin
Back to top
View user's profile Send private message
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Fri Jul 13, 2007 1:42 pm    Post subject: Reply with quote

hi,

I have used the following jcl but my output file is empty.
I dont know what mistake i have done can any one help me.

//STEP20 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=file.a,DISP=SHR
//IN2 DD DSN=file.b,DISP=SHR
//INT DD DSN=*.IN1,DISP=SHR
// DD DSN=*.IN2,DISP=SHR
//TMP1 DD DSN=&&TEMP1,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,20),RLSE),DCB=(RECFM=FB,LRECL=1008)
//OUT DD DSN=outoutfile,
// DISP=SHR,UNIT=SYSDA,
// SPACE=(CYL,(50,20),RLSE),DCB=(RECFM=FB,LRECL=1008)
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SORT FROM(INT) USING(CTL3)
//CTL1CNTL DD *
OUTFIL FNAME=IN1,OUTREC=(1,1008,C'1')
//CTL2CNTL DD *
OUTFIL FNAME=IN2,OUTREC=(1,1008,C'2')
//CTL3CNTL DD *
OPTION EQUALS
SORT FILEDS=(7,9,ZD,A)
SUM FILEDS=(1008,1,ZD)
OUTFIL FNAME=OUT,INCLUDE(1008,1,CH,EQ,3),OUTREC=(1.1008)
/*

Thanks,
Aswin
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Jul 13, 2007 2:29 pm    Post subject: Reply with quote

Aswin,

If you ran this job as you show it, it would have gotten an error message and RC=16 because FNAME=IN1 is invalid syntax (it should be FNAMES=IN1), etc. So, of course, your output would be empty. There are other syntax errors as well.

I don't know what your input looks like, what you want for output or what you're trying to do with this error riddled job. Instead of trying to fix it, let's start over so we can show you how to do what you want to do the correct way.

Show an example of the record in each input file (relevant fields only) and what you expect for output. If there are duplicates within input file1, show that in your example. If there are duplicates within input file2, show that in your example. Give the RECFM and LRECL of the input files. Give the starting position, length and format of the relevant fields.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Fri Jul 13, 2007 3:54 pm    Post subject: Reply with quote

hi,

But this job gave me areturn code of zero.

My input file has the key field start from 7 and length is 9 (comp3 field)
same in the both the input file .
the file one will have duplicate but file two will not have duplicates.

i want the the matching records form both file.

the total lenth of record is 1008 and is a Fb record.

I have also tried this but this is giving a SOC7 error
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1) USING(CTL1)
COPY FROM(IN2) TO(TMP1) USING(CTL2)
SPLICE FROM(TMP1) TO(OUT) ON(7,9,PD) WITH(1010,1) USING(CTL3)
//CTL1CNTL DD *
OUTREC FIELDS=(1,1008,C'11')
//CTL2CNTL DD *
OUTREC FIELDS=(1,1008,C'12')
//CTL3CNTL DD *
OUTFIL FNAME=OUT,INCLUDE(1009,2,CH,EQ,C'12'),OUTREC=(1,1008)
/*


Thanks,
Aswin
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Sat Jul 14, 2007 2:40 am    Post subject: Reply with quote

Aswin
Have made changes to your TOOLIN card, check here
Code:
//TOOLIN DD *
 COPY FROM(IN2) TO(TMP1) USING(CTL1)
 COPY FROM(IN1) TO(TMP1) USING(CTL2)
 SPLICE FROM(TMP1) TO(OUT) ON(7,9,PD) WITH(1010,1) USING(CTL3) WITHALL KEEPNODUPS
//CTL1CNTL DD *
 OUTREC FIELDS=(1,1009,C'11')
//CTL2CNTL DD *
 OUTREC FIELDS=(1,1009,C'22')
//CTL3CNTL DD *
 OUTFIL FNAMES=OUT,INCLUDE=(1009,2,CH,EQ,C'12'),OUTREC=(1,1008)
/*

If Still unresolved then,
1. For Clarity paste the TOOLMSG and DFSMSG.
2. Give the sample set of i/p's and expected o/p's.
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Jul 14, 2007 11:08 am    Post subject: Reply with quote

Quote:
But this job gave me a return code of zero.


I don't see how considering you have FNAME= instead of FNAMES= in three places and FILEDS= instead of FIELDS= in two places and other syntax errors as well.

I would really like to see the //TOOLMSG and //DFSMSG output for that job to see how you managed to get a RC=0 with all those syntax errors.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 16, 2007 8:41 am    Post subject: Reply with quote

hi,

Yes Guy you we correct, the step in whcih this was coded was not getting executed ."restar was coded for the step after this.
Sry

Thanks
Aswin
Back to top
View user's profile Send private message
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 16, 2007 10:58 am    Post subject: Reply with quote

hi,

I HAVE CORRECTED THE JCL AS FOLLOWIN.

MY REQUIREMENTS ARE AS FOLLOWS
My input file has the key field start from 7 and length is 9 (comp3 field)
same in the both the input file .
the file one will have duplicate but file two will not have duplicates.

i want the the matching records form both file.

the total lenth of record is 1008 and is a Fb record.

THE JCL IS

//STEP20 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=input1.,DISP=SHR
//IN2 DD DSN=input2,DISP=SHR
//TMP1 DD DSN=TMP1,DISP=(,PASS),UNIT=SYSDA,
// SPACE=(CYL,(50,100),RLSE), ,DCB=(RECFM=FB,LRECL=1008)
// VOL=(,,,99)
//TMP2 DD DSN=TMP2,DISP=(,PASS),UNIT=SYSDA,
// SPACE=(CYL,(50,100),RLSE), ,DCB=(RECFM=FB,LRECL=1008)
// VOL=(,,,99)
//INT DD DSN=*.TMP1,DISP=(OLD,PASS),VOL=REF=*.TMP1
// DD DSN=*.TMP2,DISP=(OLD,PASS),VOL=REF=*.TMP2
//OUT DD DSN=common.ouput,
//* DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// DISP=SHR,UNIT=SYSDA,
// SPACE=(CYL,(70,50),RLSE),DCB=(RECFM=FB,LRECL=1008)
//FILEA DD DSN=file1.only,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(70,50),RLSE),DCB=(RECFM=FB,LRECL=1008),
// VOL=(,,,99)
//FILEB DD DSN=.FILE2.ONLY,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(70,50),RLSE),DCB=(RECFM=FB,LRECL=1008),
// VOL=(,,,99)
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SORT FROM(INT) USING(CTL3)
//CTL1CNTL DD *
OUTFIL FNAMES=TMP1,OUTREC=(1,1008,C'1')
//CTL2CNTL DD *
OUTFIL FNAMES=TMP2,OUTREC=(1,1008,C'2')
//CTL3CNTL DD *
OPTION EQUALS
SORT FIELDS=(7,9,PD,A)
OUTFIL FNAMES=OUT,
INCLUDE=(1009,1,ZD,EQ,3),OUTREC=(1,1008)
OUTFIL FNAMES=FILEA,INCLUDE=(1009,1,ZD,EQ,1),OUTREC=(1,1008)
OUTFIL FNAMES=FILEB,INCLUDE=(1009,1,ZD,EQ,2),OUTREC=(1,1008)

THE OUPUT IS NOT AS EXPECTED THE FILEA GIVES ME THE RECORDS OF FILEB ALSO.

CAN YOU HELP ME OUT WHAT IS GOING WRONG.
I WOULD ALSO LIKE TO KNOW HOW DOES IT MERGES ALL RECOD IN FILEA FOLLOWED BY FILEB RECORDS.

THANKS,
Aswin
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jul 16, 2007 11:06 am    Post subject: Reply with quote

Aswin,

What's wrong is that your job is NOT using the correct approach. It's not even close.

Please provide the examples previously requested.

Quote:
Show an example of the record in each input file (relevant fields only) and what you expect for output. If there are duplicates within input file1, show that in your example. If there are duplicates within input file2, show that in your example.


There are numerous examples on this board of how to do the kind of thing you're trying to do. You could search for them. At the very least they will show you how to post the examples needed so somebody can help you.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 16, 2007 11:43 am    Post subject: Reply with quote

ok ,

my input file A - example
s.no name
121 xxxx t1 pass
121 xxxx t2
121 zzzz t1 pass
121 zzzz t2
121 yyyy t1 fail
121 yyyy t2
IN the first step iam geting the records which has the keword "pass"

OPTION COPY
SORT FIELDS=(4,4,PD,A)
INCLUDE COND=(168,08,CH,EQ,C'pass')

In step2 iam getting the t2 recods alone

OPTION COPY
SORT FIELDS=(7,9,PD,A)
INCLUDE COND=(9,02,CH,EQ,C'T2')

the file of both step is now used to get the t2 recods of the pass recod using the
name fields (ie xxxx yyyy zzzz) if the name between file 1(got from step1) and file2(got from step2). it should be taken.

so iam using the icetool step for this .


Ulimate requirment we know only the Keword "PASS" .WE SHOULD GET THE EQUVALENT T2 RECORD FOR THEM

HOPE I HAVE EXPLAED IT WITHOUT ANY CONFUSION.

THANKS,
Aswin
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jul 16, 2007 3:13 pm    Post subject: Reply with quote

You're not giving me what I asked for. I don't want you to explain what YOUR job is doing. I need you to take a step back and explain what you're trying to do. Nothing you've said has even made it clear how many inputs and outputs you have. You show IN1 and IN2 in your job but then only talk about input fileA. You show OUT, FILEA and FILEB but never explain what those are.

You need to explain what you're trying to do clearly. You need to show an example of the records in EACH input file (relevant fields only) and what you expect for EACH output file. If there are duplicates within input file1, show that in your example. If there are duplicates within input file2, show that in your example. Give the starting position, length and format of each relevant field. If you can't do that, then I can't help you.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> 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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group