IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT Query


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
CICS fan

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Thu Jun 19, 2008 12:50 pm
Reply with quote

I have two input files. fileA and File B.
Record length and layout are different for these two files.
Both Filea and File B contains carrier code and flight number

For file A, carrier code is at postion 1, length2
for fileB, its pos 120, length 2

for filea, flt number is pos3, length 4
for fileB, its pos 122, length 4
but for file B its in binary format and filea its displayable format

Requirement is whenver flight number AND carrier code of a rec in file B matches flt num AND carrier code of FileB, write fileB rec into fileC .If not matches write into FileD.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Thu Jun 19, 2008 12:58 pm
Reply with quote

Hi,

U can use joinkeys like below. Change the code with ur record position

THIS JCL WILL PRODUCE OUTPUT IF THE RECORD FROM F1 IS NOT FOUND IN F2.

//SORTTOOL EXEC PGM=SORT
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=DEV2.RK.TEST(SSN),DISP=SHR
//SORTJNF2 DD DSN=DEV2.RK.TEST(SSNS17),DISP=SHR
//SORTOUT DD DSN=DEV2.RK.TEST(SSNCMP),DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,9,A)
JOINKEYS FILES=F2,FIELDS=(1,9,A)
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:1,80)
/*
//*




Regards
R KARTHIK
Back to top
View user's profile Send private message
CICS fan

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Thu Jun 19, 2008 1:23 pm
Reply with quote

But I need two output files,one for matched records and another for unmatched
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 3:36 pm
Reply with quote

Hello CICS fan,

Please provide details of how your input and output looks like. ALso which sort product is installed in your site? DFSORT or SYNCSORT?

do search the forums for examples, try and then post the issues/errors that you face.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Jun 19, 2008 9:19 pm
Reply with quote

CICS fan wrote:
Reqrmnt is whenver flt number AND carrier code of a rec in file B matches flt num AND carrier code of FileB, write fileB rec into fileC .If not matches write into FileD.

I assume you mean if both carrier code and flight number from File A matches File B, then write the record from File B to File C. However, I am not clear which records you want written to file D - only the unmatched from file B, or the unmatched from File A and File B written to File D?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top