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
 

 

Compare using SYNCSORT
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
buzzvinodh_chandra

New User


Joined: 15 Jul 2009
Posts: 6
Location: US

PostPosted: Wed Jul 15, 2009 12:25 am    Post subject: Compare using SYNCSORT
Reply with quote

Hi,

I want to merge 2 PS files using SYNCSORT and get the output file based on the below conditions:

File A (LRECL=117)
*****
1
2
8
9

File B (LRECL=117)
*****
1
4
5


Output file
********
1
2
4
5
8
9


ie., All the records in File A + nonmatching records in File B.

I am using the below card and getting the output like
Code:

//CLMIXDF   EXEC PGM=SYNCSORT                                     
//SORTJNF1  DD   DSN=INPUT1             
//SORTJNF2  DD   DSN=INPUT2
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTOF01  DD   DSN=OUTPUT           
//SYSUDUMP DD SYSOUT=*                                             
//SYSIN    DD    *                                                 
  JOINKEYS FILES=F1,FIELDS=(1,1,A)                                 
  JOINKEYS FILES=F2,FIELDS=(1,1,A)                                 
  REFORMAT FIELDS=(F1:1,117,F2:1,117),FILL=X'FF'                   
  JOIN UNPAIRED                                                   
  SORT FIELDS=COPY                                                 
  OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'FF',OR,118,1,CH,NE,X'FF')   
//*                                                               

Output
*****
1
2
blank record for file B
blank record for file B
8
9


Can anyone pls help me in getting the RESULT???[/img]
Back to top
View user's profile Send private message

Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jul 15, 2009 12:51 am    Post subject:
Reply with quote

Here is a SyncSort for z/OS job that will produce your requested output:
Code:
//STEP1  EXEC PGM=SORT                             
//SORTJNF1 DD DSN=Input.File1,DISP=SHR                                 
//SORTJNF2 DD DSN=Input.File2,DISP=SHR                             
//SORTOUT  DD DSN=Output.File
//SYSOUT   DD SYSOUT=*                             
//SYSIN    DD *                                   
  JOINKEYS FILES=F1,FIELDS=(1,1,A)             
  JOINKEYS FILES=F2,FIELDS=(1,1,A)             
  JOIN UNPAIRED                               
  REFORMAT FIELDS=(F1:1,117,F2:1,117),FILL=(X'FF')
  SORT FIELDS=COPY                             
  OUTFIL IFTHEN=(WHEN=(1,1,CH,EQ,X'FF'),BUILD=(118,117)),                               
         IFTHEN=(WHEN=(NONE),BUILD=(1,117))                               
/*
Back to top
View user's profile Send private message
buzzvinodh_chandra

New User


Joined: 15 Jul 2009
Posts: 6
Location: US

PostPosted: Wed Jul 15, 2009 1:04 am    Post subject: Thanks
Reply with quote

Thanks a lot Alissa...its working now icon_biggrin.gif
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jul 15, 2009 1:09 am    Post subject:
Reply with quote

Great. Thanks for letting us know.
Back to top
View user's profile Send private message
tugga11

New User


Joined: 19 May 2009
Posts: 12
Location: Charlotte

PostPosted: Tue Sep 15, 2009 10:06 pm    Post subject: Reply to: Compare using SYNCSORT
Reply with quote

Hi Alissa Margulies
Can you please let me know the function of FILL= (X'FF) and also pls explain how the below Outfil arrived at the solution ?

OUTFIL IFTHEN=(WHEN=(1,1,CH,EQ,X'FF'),BUILD=(118,117)),
IFTHEN=(WHEN=(NONE),BUILD=(1,117))
/*

Thanks
tugga11
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Sep 15, 2009 11:18 pm    Post subject:
Reply with quote

Hello Tugga11.

Tugga11 wrote:
Can you please let me know the function of FILL= (X'FF')

JOIN UNPAIRED allows you to create a file with matched and unmatched records. When you code a REFORMAT statement which includes fields from both input files, the FILL parameter allows you to define a fill byte to be used for any missing p,l fields.

Tugga11 wrote:
pls explain how the below Outfil arrived at the solution ?
Code:
OUTFIL IFTHEN=(WHEN=(1,1,CH,EQ,X'FF'),BUILD=(118,117)),
IFTHEN=(WHEN=(NONE),BUILD=(1,117))


The OUTFIL statement says that when the FILL character is present in the first byte of the REFORMATed record (meaning no match in File 1), BUILD the record from position 118 for the length of 117, which is the data record from File 2.

When the first criteria is not met, then BUILD=(1,117), which is the data record from File 1.

Hope this helps. Let me know if you require any further clarification.
Back to top
View user's profile Send private message
tugga11

New User


Joined: 19 May 2009
Posts: 12
Location: Charlotte

PostPosted: Tue Sep 15, 2009 11:39 pm    Post subject:
Reply with quote

Thank you the explanation. Great !...
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Sat Jan 23, 2010 2:37 am    Post subject: Compare using SYNCSORT
Reply with quote

Hello:

I didn't want to post another question on the a somewhat similar subject. So, I tried to pick up the solution given here. But, obviously my requirment is a little different and I am unable tweak the given-solution to match my requiremnt. So, I need help from some one in this regard.

SYNCSORT is being used in our shop.

Input1: FB - 98
Code:
A1B2C3D4E5F6G7H8I9..... (Not all the remaining data is CHAR)
9I8H7G6F5E4D3C2B1A.....

Input2: FB - 108
Code:
2009-06-26AAAABBBBCCCCDDDD... (Not all data is CHAR)
2009-06-27EEEEFFFFGGGGHHHHHH...
2009-06-289I8H7G6F5E4D3C2B1A... ==> dup rec - shud be skipped
2009-07-07614477SSGGMIGQAAPH...

Output: FB - 108
Code:
A1B2C3D4E5F6G7H8I9...
AAAABBBBCCCCDDDD...
EEEEFFFFGGGGHHHHHH...
614477SSGGMIGQAAPH...


So, in second file first 10 bytes should be skipped while comparing for matched/unmatched records. This date data should also be omitted from the output file.

AS THIS IS SAMPLE DATA - PLEASE BEAR WITH IT (or ME?)

Here is the syntax/error message...

Code:
SYNCSORT FOR Z/OS  1.2.0.0R
    JOINKEYS FILES=F1,FIELDS=(1,98,A)
    JOINKEYS FILES=F2,FIELDS=(11,108,A)
    JOIN UNPAIRED
    REFORMAT FIELDS=(F1:1,98,F2:1,108),FILL=(X'FF')
    SORT FIELDS=COPY
    OUTFIL IFTHEN=(WHEN=(11,108,CH,EQ,X'FF'),BUILD=(11,108)),
           *
           IFTHEN=(WHEN=(NONE),BUILD=(11,108))
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Please let me know if I am missing anything.

-Dinesh
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Jan 23, 2010 4:22 am    Post subject:
Reply with quote

Hello Dinesh.

IFTHEN and BUILD support was included in SyncSort for z/OS 1.2.1. You are running an earlier release of SyncSort which does not contain this support.

Regards,
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Mon Jan 25, 2010 8:08 am    Post subject: Reply to: Compare using SYNCSORT
Reply with quote

Hello Alissa,

So, is there any other 'keyword' that I can use instead, to achieve my goal?


-Dinesh

PS:Any help in that direction is greatly appreciated.
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: Mon Jan 25, 2010 8:17 am    Post subject:
Reply with quote

Hello,

Probably not with your release of Syncsort - your product installation is way out of date. . .

If your management is unwilling to upgrade (and quickly if this is something you want soon), suggest you write code.
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Mon Jan 25, 2010 9:21 pm    Post subject:
Reply with quote

Hello Dick:

If I have enough time to write code, I wouldn't be here looking for 'quick' help.

All - I fail to find any SYNCSORT documentation in this forum (or even online???) where as I could, for other tools. Perhaps, I am missing somthing obvious - please post some links for necessary documentation as I will try to look for 'workaround' solution for the stated problem.


-Dinesh
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: Mon Jan 25, 2010 9:26 pm    Post subject:
Reply with quote

dinesh_deadman wrote:
I fail to find any SYNCSORT documentation in this forum (or even online???) where as I could, for other tools. Perhaps, I am missing somthing obvious
Try PMing Alissa Margulies, the forum moderator for instructions to get the docs.....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Jan 25, 2010 9:27 pm    Post subject: Reply to: Compare using SYNCSORT
Reply with quote

Quote:
All - I fail to find any SYNCSORT documentation in this forum


You have little chances of finding documentation for syncsort here.
different companies have different policies as far as manuals and docs are concerned.
SYNCSORT makes the docs available only to licensed customers.

ask Your support and/or have somebody get in touch with the SYNCSORT people
so that they can provide them to Your organization
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: Mon Jan 25, 2010 9:36 pm    Post subject:
Reply with quote

Hello,

Syncsort documentation is covered by copyright and we may neither post it nor link to it from our forum.

With the out of date release of the product being used, the documentation will do you no good. . .

It has been 3 days since Alissa explained that your product is too old for the feature you want to use.

Quote:
If I have enough time to write code, I wouldn't be here looking for 'quick' help.
The code shouldn't take a day (actually, not even a few hours). . . Sounds more like you'd rather have someone else do the work for you. . .
Back to top
View user's profile Send private message
dinesh_deadman
Warnings : 1

New User


Joined: 10 Aug 2007
Posts: 38
Location: Chicago

PostPosted: Mon Jan 25, 2010 10:18 pm    Post subject:
Reply with quote

Hello:

I understood and accepted what Alissa had to say, and if you read all my posts - I never
tried to make my version of SYNCSORT do what it's not supposed to do. Not sure where
you got this impression from.

All I am trying to do is look for a workaround solution, if at all there is one.
I didn't know that providing links/documentation is 'doing the work'.

I also realize what you and others had to say about the copyrights issue, and
as a result started talking to support people at my work.

Someone's having a bad day at the office.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Jan 25, 2010 10:28 pm    Post subject: Reply to: Compare using SYNCSORT
Reply with quote

Quote:
If I have enough time to write code, I wouldn't be here looking for 'quick' help.


learn to plan Your time better and You will not have the need to ask for no charge quick help

free/no charge help is based on responders time not on Your urgency

Quote:
Someone's having a bad day at the office.

maybe You are having it, not us

anyway I confirm Dick's evaluation, a simple two file match should not take
too long,
if You had started writing it instead of waiting for forums suggestions, Your issue would have been solved by now
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: Mon Jan 25, 2010 10:47 pm    Post subject:
Reply with quote

Hello,

Quote:
I didn't know that providing links/documentation is 'doing the work'.
And it is not. . . icon_smile.gif

On the other hand, sitting around for 3 days waiting for someone to post a "workaround" is. . .

If this is something you needed "quick", how was it proper to sit and wait for 3 days hoping someone would post working "code" for you. . .?
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: Mon Jan 25, 2010 10:53 pm    Post subject:
Reply with quote

dinesh_deadman wrote:
All I am trying to do is look for a workaround solution, if at all there is one.
The easiest 'workaround' is to upgrade your Syncsort........
Quote:
Someone's having a bad day at the office.
I'd agree with you but maybe not as you are thinking.....grin.....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Jan 25, 2010 10:56 pm    Post subject: Reply to: Compare using SYNCSORT
Reply with quote

Quote:
The easiest 'workaround' is to upgrade your Syncsort........


but the availability of the new functions will depend on the speed of the paper flow
and usually it' s a pretty slow flow icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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