|
View previous topic :: View next topic
|
| Author |
Message |
Balaji C
New User
Joined: 09 Apr 2015 Posts: 4 Location: India
|
|
|
|
Im a tester using File-Aid to select some records from a file. Now my requirement is to select the records based on field1 from File1 and another field2 in File2. Account number field is common in both the files.
Is there any way to filter my data like above? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Does the File-Aid documentation give you any clues or pointers? Your colleagues?
Easy task for SORT with JOINKEYS. |
|
| Back to top |
|
 |
Balaji C
New User
Joined: 09 Apr 2015 Posts: 4 Location: India
|
|
|
|
Thanks Woodger!
My colleagues dont have knowledge on mainframe. I dont have much expertise on join keys. Could you please explain me how to select some accounts based on Feild1=51 from File1 and Field2=1 thru 4 from File2. DDn1 and DDn2 are the DD names respectively
Control statements will be more helpful  |
|
| Back to top |
|
 |
rinsio
New User
Joined: 16 Feb 2015 Posts: 13 Location: Madrid, Spain
|
|
|
|
Hello Balaji,
I understand that position of Field1 start at 51.
Your control statements could be like this:
//JOINK2 EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=DDN1,
// DISP=SHR
//IN2 DD DSN=DDN2,
// DISP=SHR
//SORTOUT DD DSN=DDOUT,
// SPACE=(CYL,(40,20),RLSE),
// DISP=(,CATLG,DELETE)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(51,4,A)
JOINKEYS F2=IN2,FIELDS=(01,4,A)
REFORMAT FIELDS=(F1:1,LENGTHDDN1,F2:1,LENGTHDDN2)
OPTION COPY
/*
In the REFORMAT FIELDS command you can build the output file format. In the example tha output file contains both records.
Good luck
Regards |
|
| Back to top |
|
 |
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Balaji,
It's very disappointing that you didn't even try to Google and search for JOINKEYS when Bill suggested and you directly asked for the Control statements itself.
It wouldn't have taken more than 15 mins to do all what you wanted.
From the next time, please Google, Try, Fail and then ask others for help.
. |
|
| Back to top |
|
 |
Balaji C
New User
Joined: 09 Apr 2015 Posts: 4 Location: India
|
|
|
|
| rinsio wrote: |
Hello Balaji,
I understand that position of Field1 start at 51.
Your control statements could be like this:
//JOINK2 EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=DDN1,
// DISP=SHR
//IN2 DD DSN=DDN2,
// DISP=SHR
//SORTOUT DD DSN=DDOUT,
// SPACE=(CYL,(40,20),RLSE),
// DISP=(,CATLG,DELETE)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(51,4,A)
JOINKEYS F2=IN2,FIELDS=(01,4,A)
REFORMAT FIELDS=(F1:1,LENGTHDDN1,F2:1,LENGTHDDN2)
OPTION COPY
/*
In the REFORMAT FIELDS command you can build the output file format. In the example tha output file contains both records.
Good luck
Regards |
Thank You very much Rinsio. I have applied your logic with some modicications from Google. Finally made what I required. Thanks Again.] |
|
| Back to top |
|
 |
Balaji C
New User
Joined: 09 Apr 2015 Posts: 4 Location: India
|
|
|
|
| RahulG31 wrote: |
Balaji,
It's very disappointing that you didn't even try to Google and search for JOINKEYS when Bill suggested and you directly asked for the Control statements itself.
It wouldn't have taken more than 15 mins to do all what you wanted.
From the next time, please Google, Try, Fail and then ask others for help.
. |
Rahul, Thanks for your suggestion. I have applied above logic with some modifications from Google. Finally able to make it. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|