Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT Query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT Query
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    Post subject: Reply to: SYNCSORT Query
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Thu Jun 19, 2008 3:36 pm    Post subject: Reply to: SYNCSORT Query
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: 500
Location: USA

PostPosted: Thu Jun 19, 2008 9:19 pm    Post subject: Re: SYNCSORT Query
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    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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN/FREEMAIN query Suja.Sai CICS 9 Tue Jan 31, 2017 12:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us