Can we map 2 fields in a single step?



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Can we map 2 fields in a single step?

Postby upendra_water » Thu Jan 14, 2010 5:21 pm

I have 2 files as below:
File1: LRECL=91,RECFM=FB
File1 contains 3 digit card member country code starting at position 17 and merchant country code starting at position 34

File2: LRECL=80 and RECFM=FB
File2 is a country to market mapping file where country code is 3 digits and starts at position 10 followed by 2 spaces
and then by 4 digit market-ID.

Rules:-
I want to map card member (CM) country to CM market and merchant country to merchant market using country to mapping file. In output file CM market starts at position 17 and merchant market starts at position 35.
If country code is present in file1 is not present in mapping file (i.e. file2) then market has to be defaulted to 0099.
If country code is spaces then market has to be defaulted to spaces.

Currently I am doing this in 2 steps.
Step1: Map CM country to CM market using following control statements.
  JOINKEYS FILES=F1,FIELDS=(17,03,A)
  JOINKEYS FILES=F2,FIELDS=(10,03,A)
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,91,
                 F2:1,80)
  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(17,03,CH,GT,C' ',AND,101,03,CH,EQ,C' '),
       BUILD=(1:1,16,17:C'0099',21:20,72)),                 
      IFTHEN=(WHEN=(17,03,CH,EQ,C' '),
       BUILD=(1:1,16,17:C'0099',21:20,72)),                 
      IFTHEN=(WHEN=(17,03,CH,GT,C' ',AND,101,03,CH,NE,C' '),
       BUILD=(1:1,16,17:106,4,21:20,72))                   
  OUTREC FIELDS=(1,92)                                       


Then I map merchant country to market in next step.(Rules are same)
Step2: Map merchant country to merchant market.
  JOINKEYS FILES=F1,FIELDS=(35,03,A)
  JOINKEYS FILES=F2,FIELDS=(10,03,A)
  JOIN UNPAIRED,F1
  REFORMAT FIELDS=(F1:1,92,
                 F2:1,80)
  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(35,03,CH,GT,C' ',AND,102,03,CH,EQ,C' '),
       BUILD=(1:1,34,35:C'0099',39:38,55)),                 
      IFTHEN=(WHEN=(35,03,CH,EQ,C' '),
       BUILD=(1:1,34,35:C'0099',39:38,55)),                 
      IFTHEN=(WHEN=(35,03,CH,GT,C' ',AND,102,03,CH,NE,C' '),
       BUILD=(1:1,34,35:107,4,39:38,55))                   
  OUTREC FIELDS=(1,93)


Can I do these two mappings in 1 step?
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Can we map 2 fields in a single step?

 

Re: Can we map 2 fields in a single step?

Postby Frank Yaeger » Thu Jan 14, 2010 10:52 pm

Please show an example of the records in each input file (relevant fields only) and what you expect for output. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.

I assume you have the Nov, 2009 DFSORT PTF so you can use JOINKEYS - right?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Can we map 2 fields in a single step?

Postby upendra_water » Fri Jan 15, 2010 4:26 pm

File1: Input file. CM country starts at position 17 and merchant country starts at position 34.

1               17                 34         
----------------|------------------|----------
                123                421       
                241                           
                392                421       
                392                388       
                                   126       
                512                308       
                512                123       
                512                388       
                244                308       
                392                412       
                123                222       
                197                308       


File2: It is a country to market mapping file. It contains unique records for country code. Market may be duplicate.
Country code starts at position 10 market ID starts at position 15.
File2:
         10   15                       
---------|----|-------------------------
         001  0012                     
         002  0012                     
         003  0012                     
         042  0001                     
         096  1290                     
         123  3220                     
         179  3220                     
         188  0050                     
         205  0305                     
         213  0380                     
         222  0476                     
         241  0380                     
         244  0380                     
         308  0450                     
         392  0056                     
         412  0078                     
         417  0056                     
         421  0078                     
         495  1029
         500  0078
         512  0501


Output file:
CM market starts from position 17 and merchant market starts from position 35.
If country code is present in file1 not present in file2 then market is populated as 0099.
If country code is spaces in file1 then market is populated as 0099.


                17                35       
----------------|-----------------|---------
                3220              0078     
                0380              0099     
                0056              0078     
                0056              0099     
                0099              0099     
                0501              0450     
                0501              3220     
                0501              0099     
                0380              0450     
                0056              0078     
                3220              0476     
                0099              0450     



I can run jobs using JOINKEYS, but I am not sure how to check if Nov, 2009 DFSORT PTF is installed or not.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Can we map 2 fields in a single step?

Postby Frank Yaeger » Fri Jan 15, 2010 10:31 pm

I can run jobs using JOINKEYS, but I am not sure how to check if Nov, 2009 DFSORT PTF is installed or not.


Please run the following job and post the //SYSOUT messages you receive.

//S1    EXEC  PGM=SORT     
//SYSOUT    DD  SYSOUT=*   
//SORTIN DD *               
RECORD                     
//SORTOUT DD DUMMY         
//SYSIN    DD    *         
  OPTION COPY               
/*     
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Can we map 2 fields in a single step?

Postby upendra_water » Mon Jan 18, 2010 10:44 am

Here comes the SYSOUT.

SYNCSORT FOR Z/OS  1.3.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSORT INC.   DATE=2010/017   TIME=22.03.22
                         XXXXXXXXXXX     z/OS   1.10.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER XXXXX, MODEL 2097 707           LICENSE/PRODUCT EXPIRATION DATE: 01 AUG 2013
SYSIN :                                                                       
  OPTION COPY                                                                 
WER276B  SYSDIAG= 11204843, 14874961, 14874961, 4300725                       
WER164B  6,052K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
WER164B     0 BYTES RESERVE REQUESTED, 272K BYTES USED                       
WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER410B  5,024K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,     
WER410B     0 BYTES RESERVE REQUESTED, 156K BYTES USED                       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER416B  BSAM WAS USED FOR SORTIN                                             
WER416B  BSAM WAS USED FOR SORTOUT                                           
WER054I  RCD IN          1, OUT          1                                   
WER169I  RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1                                 
WER052I  END SYNCSORT - PY3978A3,S1,,DIAG=EE00,60C9,C286,004E,A66A,48C3,06C8,0
E62

upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Can we map 2 fields in a single step?

Postby Frank Yaeger » Mon Jan 18, 2010 11:10 pm

The WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.

I'm moving this to the Syncsort Forum. Please post Syncsort questions in that Forum in the future.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Can we map 2 fields in a single step?

Postby upendra_water » Tue Jan 19, 2010 12:40 pm

Thank you frank for routing my question to SYNCSORT section.
I will post my questions in SYNSORT section going forward.
However, can you please answer below questions?
1) How do you distinguish between DFSORT and SYNCSORT? Like you said WER in message indicates it is SYNCSORT.
So what all things are there to identify whether DFSORT or SYNCSORT is being used.
2) What does ICETOOL/ICEMAN belong to? i.e. does it belongs to SYNCSORT or DFSORT?
3) How to identify what version of a sort product is available in my orgnization and if it is latest or not?
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Can we map 2 fields in a single step?

Postby Frank Yaeger » Tue Jan 19, 2010 10:14 pm

1) How do you distinguish between DFSORT and SYNCSORT? Like you said WER in message indicates it is SYNCSORT.
So what all things are there to identify whether DFSORT or SYNCSORT is being used.


If you see ICExxxs messages, you're using DFSORT. If you see WERxxxs messages, you're using Syncsort. The messages from both products also include the name of the product. Here's an example for DFSORT:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 ...

What does ICETOOL/ICEMAN belong to? i.e. does it belongs to SYNCSORT or DFSORT?


ICE is the official IBM prefix for DFSORT. However, Syncsort ships ICEMAN and ICETOOL as aliases. So PGM=ICEMAN or PGM=SORT will invoke the sort product (DFSORT or Syncsort) at your site. PGM=ICETOOL will invoke DFSORT's ICETOOL or Syncsort's SYNCTOOL.

How to identify what version of a sort product is available in my orgnization and if it is latest or not?


For DFSORT, see:

dfsort-icetool-icegener/topic2894.html

I can't help you with Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Can we map 2 fields in a single step?

Postby upendra_water » Wed Jan 20, 2010 1:24 pm

Thanks Frank for all the information.. It was really helpful....
Can anyone please look into the original question? i.e. Can we map 2 fields in a single step (Using SYNCSORT)?
Your help is highly appreciated!
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post