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

Retain Parsed % fields in first file ipfor next file ip


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Mon Apr 18, 2011 10:31 pm
Reply with quote

Hi,
I have this job which reads in 2 files of same format, parses out the data then outputs the field values with a pipe char for spreadsheet use. ( thx for help prior on doing that type of thing ).

Code:


//PARSEIT  EXEC PGM=ICETOOL                       
//XOUT1    DD  SYSOUT=* DCB=LRECL=1233             
//XOUT2    DD  SYSOUT=* DCB=LRECL=1233             
//IN01     DD DISP=(OLD,PASS,DELETE),DSN=&&PRIOR01
//IN02     DD DISP=(OLD,PASS,DELETE),DSN=&&CURR01 
//OUT1     DD DISP=(NEW,PASS,DELETE),             
//            DSN=&&PRIOR02,                       
//            UNIT=DISK,SPACE=(CYL,(02,02),RLSE), 
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=1304) 
//OUT2     DD DISP=(NEW,PASS,DELETE),             
//            DSN=&&CURR02,                       
//            UNIT=DISK,SPACE=(CYL,(02,02),RLSE), 
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=1304) 
//SYSOUT   DD  SYSOUT=*                           
//DFSMSG   DD  SYSOUT=*                           
//SYMNOUT   DD SYSOUT=*                           
//SYMNAMES DD *                                   
TAB_DELIM_FROM_PC,X'05'                           
/*                                                 
//TOOLMSG  DD  SYSOUT=*                                         
//TOOLIN   DD  *                                               
 COPY FROM(IN01) TO(OUT1,XOUT1) USING(CTL1)                     
 COPY FROM(IN02) TO(OUT2,XOUT2) USING(CTL1)                     
//CTL1CNTL DD  *                                               
                                                               
* PARSE OUT SAPLOAD RECORDS TO A FIXED LENGTH RECORD           
 OPTION SKIPREC=1                                               
 INREC IFTHEN=(WHEN=INIT,                                       
               PARSE=(%01=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10),
               %02=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),       
               %03=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),       
               %04=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),       
               %05=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=35),       
               %06=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=35),       
               %07=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=35),       
               %08=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=20),       
               %09=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=70),       
               %10=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10),       
                %11=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=40), 
                %12=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02), 
                %13=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03), 
                %14=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10), 
                %15=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=30), 
                %16=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10), 
                %17=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=30), 
                %18=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=30), 
                %19=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=241),
                %20=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=50), 
                %21=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04), 
                %22=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=06), 
                %23=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10), 
                %24=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=16), 
                %25=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=11), 
                %26=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=15), 
                %27=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=25), 
                %28=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04), 
                %29=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04), 
                %30=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03),
                %31=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=15),
                %32=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=18),
                %33=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02),
                %34=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=60),
                %35=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=34),
                %36=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=34),
                %37=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=34),
                %38=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),
                %39=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01),
                %40=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=60),
                %41=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02),
                %42=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10),
                %43=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03),
                %44=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03),
                %45=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02),
                %46=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02),
                %47=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),
                %48=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04),
                %49=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %50=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10)
                %51=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %52=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10)
                %53=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=08)
                %54=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10)
                %55=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %56=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03)
                %57=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=05)
                %58=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=04)
                %59=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=03)
                %60=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=28)
                %61=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %62=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %63=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %64=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
                %65=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=02)
                %66=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10)
                %67=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01)
               %68=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=20),
               %69=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=20),
               %70=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=10),
               %71=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=01),
               %72=(ENDBEFR=TAB_DELIM_FROM_PC,FIXLEN=18)),
        BUILD=(%01,C'|',                                 
               %02,C'|',                                 
               %03,C'|',                                 
               %04,C'|',                                 
               %05,C'|',                                 
               %06,C'|',                                 
               %07,C'|',                                 
               %08,C'|',                                 
               %09,C'|',                                 
                %10,C'|',
                %11,C'|',
                %12,C'|',
                %13,C'|',
                %14,C'|',
                %15,C'|',
                %16,C'|',
                %17,C'|',
                %18,C'|',
                %19,C'|',
                %20,C'|',
                %21,C'|',
                %22,C'|',
                %23,C'|',
                %24,C'|',
                %25,C'|',
                %26,C'|',
                %27,C'|',
                %28,C'|',
                %29,C'|',
                %30,C'|',
                %31,C'|',
                %32,C'|',
                %33,C'|',
                %34,C'|',
                %35,C'|',
                %36,C'|',
                %37,C'|',
                %38,C'|',
                %39,C'|',
                %40,C'|',
                %41,C'|',
                %42,C'|',
                %43,C'|',
                %44,C'|',
                %45,C'|',
                %46,C'|',
                %47,C'|',
                %48,C'|',
                %49,C'|',
                %50,C'|',
                %51,C'|',
                %52,C'|',
                %53,C'|',
                %54,C'|',
                %55,C'|',
                %56,C'|',
                %57,C'|',
                %58,C'|',
                %59,C'|',
                %60,C'|',
                %61,C'|',
                %62,C'|',
                %63,C'|',
                %64,C'|',
                %65,C'|',
                %66,C'|',
                %67,C'|',
                %68,C'|',
                %69,C'|',
                %70,C'|',
                %71,C'|',
                %72))   
                       


What I am wondering is how can one retain all of the parsed variable fields so when I process the second files record I could check if %63 in file 1 is different to %63 in the next file. The second file variable %63 will be call %163 or something like that.
When they are different I will need to build output records indicating that a change was made from the last time this file was produced.

I was heading in the direction of building a Symnames file that had field1,(02,10,ch) field2,(102,110,ch) so when I run the following:
Code:


//JOIN01 EXEC PGM=ICEMAN                           
//SYSOUT  DD SYSOUT=*                               
//SORTOUT DD SYSOUT=*                               
//SORTDIAG DD DUMMY                                 
//XOUT01 DD SYSOUT=*                               
//F1ONLY   DD DISP=(NEW,PASS,DELETE),               
//            DSN=&&DELT01,                         
//            UNIT=DISK,SPACE=(CYL,(02,02),RLSE),   
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=1304)   
//F2ONLY   DD DISP=(NEW,PASS,DELETE),               
//            DSN=&&ADDS01,                         
//            UNIT=DISK,SPACE=(CYL,(02,02),RLSE),   
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=1304)   
//BOTH     DD DISP=(NEW,PASS,DELETE),               
//            DSN=&&BOTH01,                         
//            UNIT=DISK,SPACE=(CYL,(02,02),RLSE),   
//            DCB=(RECFM=FB,BLKSIZE=0,LRECL=1304)   
//XF1ONLY DD SYSOUT=*                               
//XF2ONLY DD SYSOUT=*                               
//XBOTH   DD SYSOUT=*                                       
//IN01   DD DISP=(OLD,PASS,DELETE),DSN=&&PRIOR02           
//IN02   DD DISP=(OLD,PASS,DELETE),DSN=&&CURR02             
//SYSIN DD *                                               
 JOINKEYS F1=IN01,FIELDS=(1,10,A)                           
 JOINKEYS F2=IN02,FIELDS=(1,10,A)                           
 JOIN UNPAIRED,F1,F2                                       
 REFORMAT FIELDS=(?,F1:01,1304,F2:01,1304)                 
 OPTION COPY                                               
*                                                           
* PRIOR RECORD VENDOR DELETES                               
*                                                           
 OUTFIL FNAMES=(F1ONLY,XF1ONLY),INCLUDE=(001,01,CH,EQ,C'1'),
    BUILD=(02,1304)                                         
*                                                           
* CURRENT RECORD VENDOR ADDS                               
*                                                           
 OUTFIL FNAMES=(F2ONLY,XF2ONLY),INCLUDE=(001,01,CH,EQ,C'2'),
    BUILD=(1306,1304)                                       
 *                                                       
 * CURRENT AND PRIOR SAPLOAD RECORDS FOR DELTAS         
 *                                                       
  OUTFIL FNAMES=(BOTH,XBOTH),INCLUDE=(001,01,CH,EQ,C'B'),
     BUILD=(1306,1304,02,1304) 



I can interrogate the SORTOUT dataset. Which looks like this:

Code:

  SDSF OUTPUT DISPLAY Z3A3EB   JOB50106  DSID   126 LINE 0       COLS 03- 82
 COMMAND INPUT ===>                                            SCROLL ===>
********************************* TOP OF DATA *****************************
0006480   |N001|    |ZH01|Johnson law offic                  |             
0021970   |N001|    |ZH01|who knows why we do this           |             
0080360   |N001|    |ZH01|get your beer at the git n go      |             


and the second files record is appended starting here:
Code:

 SDSF OUTPUT DISPLAY Z3A3EB   JOB50106  DSID   126 LINE 0       COLS 1307- 1386
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
0006480   |N001|    |ZH01|KEAHEY LAW OFFICE                  |                 
0021970   |N001|    |ZH01|PERMIAN BASIN RAILWAYS INC         |                 
0080360   |N001|    |ZH01|LUCAS COUNTY CLERK OF COURTS       |                 

Thoughts gentleman ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 18, 2011 10:43 pm
Reply with quote

madmartinsonxx,

I can show you a way to parse and perform the comparison in one go instead of what you are trying to do in multiple passes. However I need more details details.


After the parse what are the fields you need to compare in file 1 and file 2? I see that you are matching the first 10 bytes as key, is that the only key ? If that is the key do you want to validate %63 in file 1 to %63 in the next file AFTER the match is completed on the key?
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Tue Apr 19, 2011 12:39 am
Reply with quote

Yes, Skolusu. The first 10 bytes is the key, and, the only key in the 2 files. Validation is done after a match as well. Some of these keys may be additions ( new in file 1 ) or deletions ( not in file 2 ).
So, from parsed variable %02 through %72 in file one needs to be compared one on one against %02 through %72 in the second file ( file 2 ). This is because the business wants to know exactly which of these fields have changed. Every time a change is identified I need to output the key, the previous % variable then the current % variable. Oh, and in pipe delimited spreadsheet of course.

I will just bet, probably as you would too, that I will be asked the question 'why has this changed for this vendor'. And I won't have a clue because approximately 4 other systems which I dont know anything about had something to do with creating these files !!! So, they want to track this going forward.

Please ask questions if you need too. Thanks.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Apr 19, 2011 2:04 am
Reply with quote

madmartinsonxx,

Here is a DFSORT JCL which will parse and them compare the matched records field by field and then write them out with indicators. I just showed 5 fields and you can extend that to all the 72 parsed fields.

I took your sample input and changed the pipe symbol to tab character for my test data and added a few records to illustrate the match function.

The output contains 4 different type records

Code:

MCH  = Match on the key and ALL the other fields are identical in both files
MBD  = Match on the key BUT one of the field is different
NEW  = A new record which only exists in FILE 1
DEL  = A deleted record which only exists in FILE 2


Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//IN1      DD *                                             
0001111    N001      ZH01 ALL FIELDS MATCH                 
0006480    N001      ZH01 JOHNSON LAW OFFICE                 
0021970    N001      ZH01 PERMIAN BASIN RAILWAYS INC       
0080360    N001      ZH01 LUCAS COUNTY CLERK OF COURTS     
7777777    N001      ZH01 NEW RECORD                       
//IN2      DD *                                             
0001111    N001      ZH01 ALL FIELDS MATCH                 
0006480    N001      ZH01 KEAHEY LAW OFFICE                 
0021970    N001      ZH02 PERMIAN BASIN RAILWAYS INC       
0080360    N003      ZH01 LUCAS COUNTY CLERK OF COURTS     
8888888    N001      ZH01 DELETED RECORD                   
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=IN1,FIELDS=(1,10,A)                                     
  JOINKEYS F2=IN2,FIELDS=(1,10,A)                                     
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(F1:1,1304,F2:1,1304,?)                             
                                                                     
  OUTFIL IFTHEN=(WHEN=(2609,1,CH,EQ,C'1'),BUILD=(C'NEW|',1,1304)),   
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'2'),BUILD=(C'DEL|',1305,1304)),       
                                                                     
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(12,5,CH,NE,1316,5,CH)),       
  BUILD=(C'MBD|',1,11,12,5,1316,5,C'%01 FIELD DOES NOT MATCH|')),     
                                                                     
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(17,5,CH,NE,1321,5,CH)),       
  BUILD=(C'MBD|',1,11,17,5,1321,5,C'%02 FIELD DOES NOT MATCH|')),     
                                                                     
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(22,5,CH,NE,1326,5,CH)),       
  BUILD=(C'MBD|',1,11,22,5,1326,5,C'%03 FIELD DOES NOT MATCH|')),     
                                                               
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(27,36,CH,NE,1331,36,CH)),   
  BUILD=(C'MBD|',1,11,27,36,1331,36,C'%04 FIELD DOES NOT MATCH|')),       
 
 .... all your other 66 parsed fields comparision   
                                                                     
  IFTHEN=(WHEN=NONE,BUILD=(C'MCH|',1,1304))                           
//*
//JNF1CNTL DD *
  OPTION SKIPREC=1
  INREC PARSE=(%01=(ENDBEFR=X'05',FIXLEN=10),               
               %02=(ENDBEFR=X'05',FIXLEN=04),               
               %03=(ENDBEFR=X'05',FIXLEN=04),               
               %04=(ENDBEFR=X'05',FIXLEN=04),               
               %05=(ENDBEFR=X'05',FIXLEN=35),               
               %06=(ENDBEFR=X'05',FIXLEN=35),               
               %07=(ENDBEFR=X'05',FIXLEN=35),               
               %08=(ENDBEFR=X'05',FIXLEN=20),               
               %09=(ENDBEFR=X'05',FIXLEN=70),               
               %10=(ENDBEFR=X'05',FIXLEN=10),               
               %11=(ENDBEFR=X'05',FIXLEN=40),               
               %12=(ENDBEFR=X'05',FIXLEN=02),               
               %13=(ENDBEFR=X'05',FIXLEN=03),               
               %14=(ENDBEFR=X'05',FIXLEN=10),               
               %15=(ENDBEFR=X'05',FIXLEN=30),               
               %16=(ENDBEFR=X'05',FIXLEN=10),               
               %17=(ENDBEFR=X'05',FIXLEN=30),               
               %18=(ENDBEFR=X'05',FIXLEN=30),               
               %19=(ENDBEFR=X'05',FIXLEN=241),               
               %20=(ENDBEFR=X'05',FIXLEN=50),               
               %21=(ENDBEFR=X'05',FIXLEN=04),               
               %22=(ENDBEFR=X'05',FIXLEN=06),               
               %23=(ENDBEFR=X'05',FIXLEN=10),               
               %24=(ENDBEFR=X'05',FIXLEN=16),               
               %25=(ENDBEFR=X'05',FIXLEN=11),               
               %26=(ENDBEFR=X'05',FIXLEN=15),               
               %27=(ENDBEFR=X'05',FIXLEN=25),               
               %28=(ENDBEFR=X'05',FIXLEN=04),               
               %29=(ENDBEFR=X'05',FIXLEN=04),               
               %30=(ENDBEFR=X'05',FIXLEN=03),               
               %31=(ENDBEFR=X'05',FIXLEN=15),               
               %32=(ENDBEFR=X'05',FIXLEN=18),               
               %33=(ENDBEFR=X'05',FIXLEN=02),               
               %34=(ENDBEFR=X'05',FIXLEN=60),               
               %35=(ENDBEFR=X'05',FIXLEN=34),               
               %36=(ENDBEFR=X'05',FIXLEN=34),               
               %37=(ENDBEFR=X'05',FIXLEN=34),               
               %38=(ENDBEFR=X'05',FIXLEN=04),               
               %39=(ENDBEFR=X'05',FIXLEN=01),                   
               %40=(ENDBEFR=X'05',FIXLEN=60),                   
               %41=(ENDBEFR=X'05',FIXLEN=02),                   
               %42=(ENDBEFR=X'05',FIXLEN=10),                   
               %43=(ENDBEFR=X'05',FIXLEN=03),                   
               %44=(ENDBEFR=X'05',FIXLEN=03),                   
               %45=(ENDBEFR=X'05',FIXLEN=02),                   
               %46=(ENDBEFR=X'05',FIXLEN=02),                   
               %47=(ENDBEFR=X'05',FIXLEN=04),                   
               %48=(ENDBEFR=X'05',FIXLEN=04),                   
               %49=(ENDBEFR=X'05',FIXLEN=01),                   
               %50=(ENDBEFR=X'05',FIXLEN=10),                   
               %51=(ENDBEFR=X'05',FIXLEN=01),                   
               %52=(ENDBEFR=X'05',FIXLEN=10),                   
               %53=(ENDBEFR=X'05',FIXLEN=08),                   
               %54=(ENDBEFR=X'05',FIXLEN=10),                   
               %55=(ENDBEFR=X'05',FIXLEN=01),                   
               %56=(ENDBEFR=X'05',FIXLEN=03),                   
               %57=(ENDBEFR=X'05',FIXLEN=05),                   
               %58=(ENDBEFR=X'05',FIXLEN=04),                   
               %59=(ENDBEFR=X'05',FIXLEN=03),                   
               %60=(ENDBEFR=X'05',FIXLEN=28),                   
               %61=(ENDBEFR=X'05',FIXLEN=01),                   
               %62=(ENDBEFR=X'05',FIXLEN=01),                   
               %63=(ENDBEFR=X'05',FIXLEN=01),                   
               %64=(ENDBEFR=X'05',FIXLEN=01),                   
               %65=(ENDBEFR=X'05',FIXLEN=02),                   
               %66=(ENDBEFR=X'05',FIXLEN=10),                   
               %67=(ENDBEFR=X'05',FIXLEN=01),                   
               %68=(ENDBEFR=X'05',FIXLEN=20),                   
               %69=(ENDBEFR=X'05',FIXLEN=20),                   
               %70=(ENDBEFR=X'05',FIXLEN=10),                   
               %71=(ENDBEFR=X'05',FIXLEN=01),                   
               %72=(ENDBEFR=X'05',FIXLEN=18)),
  BUILD=(%01,C'|',%02,C'|',%03,C'|',%04,C'|',%05,C'|',%06,C'|',   
         %07,C'|',%08,C'|',%09,C'|',%10,C'|',%11,C'|',%12,C'|',   
         %13,C'|',%14,C'|',%15,C'|',%16,C'|',%17,C'|',%18,C'|',   
         %19,C'|',%20,C'|',%21,C'|',%22,C'|',%23,C'|',%24,C'|',   
         %25,C'|',%26,C'|',%27,C'|',%28,C'|',%29,C'|',%30,C'|',   
         %31,C'|',%32,C'|',%33,C'|',%34,C'|',%35,C'|',%36,C'|',   
         %37,C'|',%38,C'|',%39,C'|',%40,C'|',%41,C'|',%42,C'|',   
         %43,C'|',%44,C'|',%45,C'|',%46,C'|',%47,C'|',%48,C'|',   
         %49,C'|',%50,C'|',%51,C'|',%52,C'|',%53,C'|',%54,C'|',   
         %55,C'|',%56,C'|',%57,C'|',%58,C'|',%59,C'|',%60,C'|',   
         %61,C'|',%62,C'|',%63,C'|',%64,C'|',%65,C'|',%66,C'|',   
         %67,C'|',%68,C'|',%69,C'|',%70,C'|',%71,C'|',%72,C'|')
//*
//JNF2CNTL DD *
  copy the same control cards as JNF1CNTL as they parse the same fields
//*



The output from this job is as follows

Code:

MCH|0001111   |N001|    |ZH01|ALL FIELDS MATCH                   | 
MBD|0006480   |JOHNSON LAW OFFICE   |KEAHEY LAW OFFICE  |%04 FIELD DOES NOT MATCH|
MBD|0021970   |ZH01|ZH02|%03 FIELD DOES NOT MATCH|                 
MBD|0080360   |N001|N003|%01 FIELD DOES NOT MATCH|                 
NEW|7777777   |N001|    |ZH01|NEW RECORD                         | 
DEL|8888888   |N001|    |ZH01|DELETED RECORD                     | 
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Tue Apr 19, 2011 2:26 am
Reply with quote

whoo hoo !! I got 6 of these right behind it. now my fingers wont go numb typing in all the field offsets. Hot snot.
Hey !! Mind if call my JCL Deck Skolusu ?
thank you, thank you thank you. I would never have pulled that one off.
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Wed Apr 20, 2011 11:27 pm
Reply with quote

i have tried hit=next, when=init but get syntax issues.
how do i make this code catch every change in the record as it works its way down please.
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Apr 21, 2011 12:23 am
Reply with quote

Code:

IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(643,051,CH,NE,1947,051,CH)),
BUILD=(C'CHG|',135,01,C'|',                                       
1,11,643,051,1947,051,C'%20 FIELD CHANGED'),                     
HIT=NEXT),                                                       
                                                                 
IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(694,005,CH,NE,1998,005,CH)),
BUILD=(C'CHG|',135,01,C'|',                                       
1,11,694,005,1998,005,C'%21 FIELD CHANGED'),                     
HIT=NEXT),                                                       
                                                                 
IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(699,007,CH,NE,2003,007,CH)),
BUILD=(C'CHG|',135,01,C'|',                                       
1,11,699,007,2003,007,C'%22 FIELD CHANGED'),                     
HIT=NEXT),                                                       


i thought this code might work but still only one change is reported.
thanks again.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 21, 2011 1:56 am
Reply with quote

madmartinsonxx wrote:

i thought this code might work but still only one change is reported.
thanks again.


If you need multiple changes then you need validate the other fields also

The max compare fields is 256 so split the other fields to be validated into chunks of 256 bytes.
ex:

Code:

IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,             
             (643,051,CH,NE,1947,051,CH),AND,   
             (694,256,CH,EQ,1998,256,CH),AND,   
             (901,256,CH,EQ,2055,256,CH)),       
....


or alternatively use OUTREC and set a flag at the end checking individual fields and use that flag field on OUTFIL to write more than 1 record using /
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Apr 21, 2011 4:00 am
Reply with quote

if use this code as the only statement in my IFTHEN in the above mentioned logic to get changes;

Code:

  OUTFIL FNAMES=XOUT01,
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(12,5,CH,NE,1316,5,CH)),
  BUILD=(C'CHG|',135,01,C'|',                                 
   1,11,12,5,1316,5,C'%02 FIELD CHANGED'))


my procedure does not abend.
when i try to compare the 2 records against each other like this:
Code:

  OUTFIL FNAMES=XOUT01,                                             
  IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,  (01,1304,CH,NE,1305,1304,CH)),
  BUILD=(C'CHG|',135,01,C'|',                                       
   1,11,12,5,1316,5,C'%02 FIELD CHANGED'))


i get this:

Code:

ICE270I 0 PROCESSING SYMNAMES STATEMENTS                                       
ICE280I 1 ORIGINAL STATEMENTS FROM SYSIN    FOLLOW                             
           OPTION COPY                                                         
           JOINKEYS F1=IN1,FIELDS=(1,10,A)                                     
           JOINKEYS F2=IN2,FIELDS=(1,10,A)                                     
           JOIN UNPAIRED                                                       
           REFORMAT FIELDS=(F1:1,1304,F2:1,1304,?)                             
                                                                               
           OUTFIL FNAMES=XOUT01,                                               
           IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(01,1304,CH,NE,1305,1304,CH)),   
           BUILD=(C'CHG|',135,01,C'|',                                         
            1,11,12,5,1316,5,C'%02 FIELD CHANGED'))                             
                                                                               
ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED                             
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 18:14 ON WED AP
           OPTION COPY                                                         
           JOINKEYS F1=IN1,FIELDS=(1,10,A)                                     
           JOINKEYS F2=IN2,FIELDS=(1,10,A)                                     
           JOIN UNPAIRED                                                       
           REFORMAT FIELDS=(F1:1,1304,F2:1,1304,?)                             
           OUTFIL FNAMES=XOUT01,IFTHEN=(WHEN=(2609,1,CH,EQ,C'B',AND,(01,1304,CH,
                         E,1305,1304,CH)),BUILD=(C'CHG|',135,01,C'|',1,11,12,5,1
                         16,5,C'%02 FIELD CHANGED'))                           
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2                 
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR IN1      - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR IN2      - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=2609                                   
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE221A 1 INVALID FIELD OR CONSTANT IN XOUT01   IFTHEN 1 CONDITION 2           
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E9-K51707 E7-K51707           
ICE052I 3 END OF DFSORT                                                         


is there a max i can compare against ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Apr 21, 2011 5:29 am
Reply with quote

madmartinsonxx wrote:
is there a max i can compare against ?


madmartinsonxx,

Did you miss reading this in my earlier post? I showed you an example of comparing 256 bytes.

skolusu wrote:
The max compare fields is 256 so split the other fields to be validated into chunks of 256 bytes.

madmartinsonxx wrote:

Code:
ICE221A 1 INVALID FIELD OR CONSTANT IN XOUT01   IFTHEN 1 CONDITION 2           



If you looked up the error messages ICE221A you would have found that the limit is 256. Check this link for a detailed explanation of the error

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CM50/2.2.211
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Thu Apr 21, 2011 6:01 am
Reply with quote

ok, gotcha. what i thought you were saying in previous post is that i could only have 256 in one ifthen=when. like 256 in a row.
i will adjust the proc.
ty.
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Wed Apr 27, 2011 6:13 pm
Reply with quote

Code:

IFTHEN=(WHEN=NONE,

pertaining to this post and the great advice therein is there a way when the preceding conditions do not get satisfied and there is a WHEN=NONE raised to 'do nothing' ? like maybe write to a DD DUMMY ?

reason for this is i am using this identical logic in another proc and a S222 is happening do to the large volume of data i am not dealing with. that is what this shop forces if estimated lines are exceeded too many times.
thanks.

p.s. yes i looked around at other posts and the manual.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Apr 27, 2011 9:45 pm
Reply with quote

madmartinsonxx wrote:
Code:

IFTHEN=(WHEN=NONE,

pertaining to this post and the great advice therein is there a way when the preceding conditions do not get satisfied and there is a WHEN=NONE raised to 'do nothing' ? like maybe write to a DD DUMMY ?


Not really. When=NONE is applied when all the other when=cond are false. In your case when=none is to capture the record which is a match and ALL the fields are identical from both files. And it writes the record with MCH indicator and record from file 1 (it doesn't matter which file record you write out as both the records are identical).

Quote:

reason for this is i am using this identical logic in another proc and a S222 is happening do to the large volume of data i am not dealing with. that is what this shop forces if estimated lines are exceeded too many times.thanks.


S222 abend is an "operator cancel" abend. Did you talk to your systems folks and see as to why they might have canceled the job? Are the files on tape?

p.s. yes i looked around at other posts and the manual.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Apr 27, 2011 10:28 pm
Reply with quote

Martin,

Two comments:

Quote:
is a WHEN=NONE raised to 'do nothing'


Depends on what you mean by "do nothing". If you mean "don't make any changes to the record", you can use something like this as a NOP:

Code:

  WHEN=NONE,OVERLAY=(1:1,1)


If you mean something else, you need to explain what you mean.

This will overlay position 1 with the character in position 1 which essentially does "nothing".

Quote:
i have tried hit=next, when=init but get syntax issues.


WHEN=INIT clauses are always treated as if HIT=NEXT was specified, so you can't specify HIT=NEXT for them. WHEN=INIT and WHEN=GROUP clauses must be first and are ALL processed regardless of the results of the previous clause.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top