Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
New output file based on comparing a field from one file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kondru

New User


Joined: 22 Mar 2010
Posts: 11
Location: india

PostPosted: Thu May 27, 2010 7:49 pm    Post subject: New output file based on comparing a field from one file.
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 27, 2010 7:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kondru

New User


Joined: 22 Mar 2010
Posts: 11
Location: india

PostPosted: Thu May 27, 2010 8:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 27, 2010 8:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ravi_singh02

New User


Joined: 28 May 2010
Posts: 2
Location: Bangalore

PostPosted: Fri May 28, 2010 5:53 pm    Post subject: Reply to: New output file based on comparing a field from on
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri May 28, 2010 6:02 pm    Post subject: Re: Reply to: New output file based on comparing a field fro
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri May 28, 2010 6:40 pm    Post subject: Re: New output file based on comparing a field from one file
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri May 28, 2010 8:47 pm    Post subject:
Reply with quote

Hello,

So far, i've not JOINed a single file. . .(to itself?). Is this an option?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri May 28, 2010 9:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us