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
 
Syncsort - Packed decimal comparison

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

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Tue Oct 19, 2010 4:26 pm    Post subject: Syncsort - Packed decimal comparison
Reply with quote

Hi,

I had 2 input files in which i need to compare to one of the field which is a packed decimal in both the files
and if it matches then i need to extract those records in one separate file and then I need to extract the unmatched
records of file1 in one file and unmatched records of file2 separately in another file.

I tried tried this with Joinkeys but I dont know to extract the whole records, i first converted the PD to ZD
format of only the required field and extrated, but i need the whole record. Please help and expalin how to
deal with the packed decimals.

My Input file1:

starting postion -- 2 and length is 4 (so with hex on, in PD condition length is 8 including signed digit)


file1
========

Code:
1.hÂ<.....FRAUD0488624             POTENTIA           
1.hÂ*.....FRAUD0488625             POTENTIA           
1.hÂ%.....FRAUD0488626             POTENTIA           
1.hÂð.....FRAUD0488628             POTENTIA           
1 êcð     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êcæ     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL

with hex on


1.hÂð.....FRAUD0488628             POTENTIA                                     
F086800000CDCECFFFFFFF4444444444444DDECDECC4444444444444444444444444444444444444
1482C0000C6914404886280000000000000763553910000000000000000000000000000000000000
 ------------------------------------------------------------------------------
1.hÂæ.....FRAUD0488629             POTENTIA                                     
F086900000CDCECFFFFFFF4444444444444DDECDECC4444444444444444444444444444444444444
1482C0000C6914404886290000000000000763553910000000000000000000000000000000000000
 ------------------------------------------------------------------------------
1.hÄ......FRAUD0488631             POTENTIA                                     
F086100000CDCECFFFFFFF4444444444444DDECDECC4444444444444444444444444444444444444
1483C0000C6914404886310000000000000763553910000000000000000000000000000000000000
 ------------------------------------------------------------------------------
1.hÄ......FRAUD0488632             POTENTIA                                     
F086200000CDCECFFFFFFF4444444444444DDECDECC4444444444444444444444444444444444444
1483C0000C6914404886320000000000000763553910000000000000000000000000000000000000
 ------------------------------------------------------------------------------

 1 êc      'ABU JIBRIL'             MICHAEL                             
 F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
 1 êc      'ABU JIBRIL'             MICHAEL                             
 F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
-------------------------------------------------------------------------





file2
========


Code:
1 êcð     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êcæ     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êd      A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êd      A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL JALAN BIMA BLOK C NO 1
1 êd      ABDALLAH                 KATHRIN                             


with hex on


 1 êc      'ABU JIBRIL'             MICHAEL                             
 F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
 1 êc      'ABU JIBRIL'             MICHAEL                             
 F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
 1 êc<     'ABU JIBRIL'             MICHAEL                             
 F0584000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
 1 êc*     'ABU JIBRIL'             MICHAEL                             
 F0585000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
 1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
 1 êc%     'ABU JIBRIL'             MICHAEL        JALAN BIMA BLOK C NO 1
 F0586000007CCE4DCCDCD74444444444444DCCCCCD44444444DCDCD4CCDC4CDDD4C4DD4F
 1923C0000CD1240192993D00000000000004938153000000001131502941023620305601


Comparing is like from file1 after zd conversion(position 2-5) is 0952832 = 0488629 and so on..


Code:
Output file1:
------------
1 êcð     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êcæ     A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL


Output file2:
------------
1.hÂ<.....FRAUD0488624             POTENTIA           
1.hÂ*.....FRAUD0488625             POTENTIA           
1.hÂ%.....FRAUD0488626             POTENTIA           
1.hÂð.....FRAUD0488628             POTENTIA


Output file3:
------------
1 êd      A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL                       
1 êd      A RAHMAN MOHAMAD IQBAL   MICHAEL DEPAUL JALAN BIMA BLOK C NO 1
1 êd      ABDALLAH                 KATHRIN
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 967
Location: Richmond, Virginia

PostPosted: Tue Oct 19, 2010 5:27 pm    Post subject:
Reply with quote

Note how, since you did not use the "code" tag, your hex display does not line up vertically, making it a nuisance, at best, for others (and you) to see which hex value lines up with each display character.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 967
Location: Richmond, Virginia

PostPosted: Tue Oct 19, 2010 6:40 pm    Post subject:
Reply with quote

Thanks for re-doing with code tags.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Tue Oct 19, 2010 6:54 pm    Post subject:
Reply with quote

Hi Senthilkumar k,

Based on your HEX value i have prepared the input. Assumed LRECL=80, RECFM=FB. JOB can be changed appropriately.
Input 1:
Code:
1 hÂð     FRAUD0488628             POTENTIA                             
F086800000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1482C0000C69144048862800000000000007635539100000000000000000000000000000
1 hÂæ     FRAUD0488629             POTENTIA                             
F086900000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1482C0000C69144048862900000000000007635539100000000000000000000000000000
1 hÄ      FRAUD0488631             POTENTIA                             
F086100000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1483C0000C69144048863100000000000007635539100000000000000000000000000000
1 hÄ      FRAUD0488632             POTENTIA                             
F086200000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1483C0000C69144048863200000000000007635539100000000000000000000000000000
1 êc      'ABU JIBRIL'             MICHAEL                             
F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc      'ABU JIBRIL'             MICHAEL                             
F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000

Input 2:
Code:
1 êc      'ABU JIBRIL'             MICHAEL                             
F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc      'ABU JIBRIL'             MICHAEL                             
F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc<     'ABU JIBRIL'             MICHAEL                             
F0584000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc*     'ABU JIBRIL'             MICHAEL                             
F0585000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc%     'ABU JIBRIL'             MICHAEL        JALAN BIMA BLOK C NO 1
F0586000007CCE4DCCDCD74444444444444DCCCCCD44444444DCDCD4CCDC4CDDD4C4DD4F
1923C0000CD1240192993D00000000000004938153000000001131502941023620305601

Sort JCL:
Code:
//STEP10   EXEC PGM=SORT                                   
//*                                                       
//SYSOUT   DD  SYSOUT=*                                   
//*                                                       
//SORTJNF1 DD DISP=SHR,DSN=<Input File 1>
//SORTJNF2 DD DISP=SHR,DSN=<Inout File 2>
//*                                                       
//OUT      DD DSN=<Matched Output file>                   
//UN1      DD DSN=<Unmatched1 Output file>                 
//UN2      DD DSN=<Unmatched2 Output file>                 
//*                                                       
//SYSIN    DD  *    *** CONSTANT CONTROL CARDS ***         
  JOINKEYS FILES=F1,FIELDS=(2,4,A)                         
  JOINKEYS FILES=F2,FIELDS=(2,4,A)                         
  JOIN UNPAIRED                                           
  REFORMAT FIELDS=(F1:1,80,?,F2:1,80)                     
  OPTION COPY                                             
  OUTFIL FNAMES=UN1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
  OUTFIL FNAMES=UN2,INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(82,80)
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'B'),BUILD=(1,80)

Matched Output File:
Code:
1 êc      'ABU JIBRIL'             MICHAEL                             
F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc      'ABU JIBRIL'             MICHAEL                             
F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000

Unmatched Output File1:
Code:
1 hÂð     FRAUD0488628             POTENTIA                             
F086800000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1482C0000C69144048862800000000000007635539100000000000000000000000000000
1 hÂæ     FRAUD0488629             POTENTIA                             
F086900000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1482C0000C69144048862900000000000007635539100000000000000000000000000000
1 hÄ      FRAUD0488631             POTENTIA                             
F086100000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1483C0000C69144048863100000000000007635539100000000000000000000000000000
1 hÄ      FRAUD0488632             POTENTIA                             
F086200000CDCECFFFFFFF4444444444444DDECDECC44444444444444444444444444444
1483C0000C69144048863200000000000007635539100000000000000000000000000000

Unmatched Output File 2:
Code:
1 êc<     'ABU JIBRIL'             MICHAEL                             
F0584000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc*     'ABU JIBRIL'             MICHAEL                             
F0585000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc%     'ABU JIBRIL'             MICHAEL        JALAN BIMA BLOK C NO 1
F0586000007CCE4DCCDCD74444444444444DCCCCCD44444444DCDCD4CCDC4CDDD4C4DD4F
1923C0000CD1240192993D00000000000004938153000000001131502941023620305601

Hope this helps you.
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Wed Oct 20, 2010 12:30 pm    Post subject:
Reply with quote

Hi Nelson,

My file record length is 1000 FB.
input1 and input2 files are production files hence it is not possible for me convert or change file
the format.I have shown my input file format earlier in the post, for better understanding i showed the file with
HEX ON, but those cannot be done in production. Also i tried ur code but still i received an error message as
Code:

SYSIN :                                                             
  JOINKEYS FILES=F1,FIELDS=(2,4,A)                                   
  JOINKEYS FILES=F2,FIELDS=(2,4,A)                                   
  JOIN UNPAIRED                                                     
  REFORMAT FIELDS=(F1:1,1000,?,F2:1,1000)                           
                            *                                       
  OPTION COPY                                                       
  OUTFIL FNAMES=UN1,INCLUDE=(1001,1,CH,EQ,C'1'),BUILD=(1,1000)       
  OUTFIL FNAMES=UN2,INCLUDE=(1001,1,CH,EQ,C'2'),BUILD=(1002,1000)   
  OUTFIL FNAMES=OUT,INCLUDE=(1001,1,CH,EQ,C'B'),BUILD=(1,1000)       
WER268A  REFORMAT STATEMENT: SYNTAX ERROR                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                       
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                       


Could please suggest me how to get the exact output in the same format which i had mentioned earlier without
affecting the input file.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Oct 20, 2010 7:05 pm    Post subject:
Reply with quote

Hi Senthilkumar k,

Quote:
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

As per the above statement the sort product called by your shop is SYNCSORT not DFSORT. I have not worked in SYNCSORT. The above code is working fine in DFSORT without any issues.

Hope someone will help in giving the solution in SYNCSORT. From next time please try to post your query in correct forum.
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: Wed Oct 20, 2010 8:43 pm    Post subject:
Reply with quote

Hello,

Quote:
without affecting the input file.
No sort process should "affect the input file". . .

Suggest you remove the ,? in the REFORMAT line.

I'm not able to test this or i'd have confirmed this as well as the rest of the syntax.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Oct 20, 2010 8:48 pm    Post subject:
Reply with quote

Hi,

Here we have a example for SYNCSORT JOINKEYS (Anuj Dhawan Post).
http://ibmmainframes.com/viewtopic.php?t=51274&highlight=joinkeys
Hope this helps you.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Tue Nov 02, 2010 9:41 pm    Post subject:
Reply with quote

Here is a sample job that may also help you:
Code:
//SORT1  EXEC PGM=SORT                                       
//SORTJNF1 DD DSN=INPUT.FILE1                       
//SORTJNF2 DD DSN=INPUT.FILE2                       
//SORTOF01 DD DSN=UNMATCHED.FROM.FILE1                       
//SORTOF02 DD DSN=UNMATCHED.FROM.FILE2                       
//SORTOF03 DD DSN=MATCHED.RECORDS                           
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                             
   JOINKEYS FILES=F1,FIELDS=(2,4,A)                         
   JOINKEYS FILES=F2,FIELDS=(2,4,A)                         
   JOIN UNPAIRED                                             
   REFORMAT FIELDS=(F1:1,1000,F2:1,1000)                     
   SORT FIELDS=COPY                                         
   OUTFIL FILES=01,INCLUDE=(1001,1,CH,EQ,C' '),BUILD=(1,1000)
   OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C' '),BUILD=(1001,1000)
   OUTFIL FILES=03,SAVE                                     
/*                                                           
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm

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