View previous topic :: View next topic
|
Author |
Message |
kondru
New User
Joined: 22 Mar 2010 Posts: 11 Location: india
|
|
|
|
Hi,
I have a file with 4 fields, file is fixed length of 260 length.
Input File
------------
AC0000000011AA....
AC0000000011II......
AC0000000012AA......
AC0000000012II......
AC0000000013II......
AC0000000014II......
AC0000000015AA......
AC0000000016AA.....
AC- Account type
0000000011 - account number
AA -flag type.
I need to write a new with following condition
new output file contains only record with flag type II, But this record must have a record with same account number and flag type AA.
The output record should contain the following records.
Output file:
------------
AC0000000011II......
AC0000000012II......
Please advice me, how to do this using SORT.
Regards,
KDR |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
FB or VB ? Length of fields ?
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.
If the messages start with ICE then your product is DFSORT and will be moved to the correct forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.
If the messages start with WER or SYT then the product is SYNCSORT and the topic will be remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.
Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
kondru
New User
Joined: 22 Mar 2010 Posts: 11 Location: india
|
|
|
|
Hi,
It is fixed block length of 260. I am using SYNCSORT. I am not sure which version it is.
AC- Account type - lenght 2
0000000011 - account number - length -20
AA -flag type - length 2
Regards, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
kondru wrote: |
I am using SYNCSORT. I am not sure which version it is. |
If you look at the sysout from the dummy job I posted previously then you will be able to find out. The release level is important as it will affect the solutions which can be used to resolve your question.
Please run the job and post the required information. |
|
Back to top |
|
|
ravi_singh02
New User
Joined: 28 May 2010 Posts: 2 Location: Bangalore
|
|
|
|
Hi,
Can't say with Sort but this can be done with DFSORT as you give the INCLUDE = (condition fulfilling the Requirement you can give as (20,2 eq,'AA'))
So, you can try out that way.
Thanks,
Ravi. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ravi_singh02 wrote: |
Can't say with Sort but this can be done with DFSORT as you give the INCLUDE = (condition fulfilling the Requirement you can give as (20,2 eq,'AA')) |
Well, that was about as useful as a chocolate teapot. Please read the requirement properly before commenting.
@kondru
Can you not use SELECT to find the matching records. I know how to do it in DFSORT but unfortunately I'm not a SYNCSORT user so can't really help too much apart from giving an idea on how to do this. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
kondru wrote: |
new output file contains only record with flag type II, But this record must have a record with same account number and flag type AA. |
Seems like a fairly simple application for JOIN/JOINKEYS.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
So far, i've not JOINed a single file. . .(to itself?). Is this an option? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Can't F1 and F2 be the same file?
The joinkey allows include/omit so the one file can appear as two different ones. |
|
Back to top |
|
|
|