Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
IFTHEN HIT=NEXT BUILR should create muliple recs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Fri Jan 10, 2020 10:49 pm    Post subject: IFTHEN HIT=NEXT BUILR should create muliple recs
Reply with quote

I am trying to get same record with different "TEXT" when a difference exists. Multiple records one for each IFTHEN=WHEN= match.

Code:

//STEP01 EXEC PGM=ICETOOL,REGION=0M                 
//SYSOUT   DD SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SYSDUMP  DD SYSOUT=*                             
//INDD1    DSN=KCSPEER.IDEDB2U.TBGPASTC.DATAFILE
//INDD2    DSN=KCSPEER.QA1DB2U.TBGPASTC.DATAFILE
//OUT01    DSN=KCSPEER.IDE.NOTQA1.TBGPASTC
//OUT02  DSN=KCSPEER.NOTIDE.QA1.TBGPASTC
//OUT03  DSN=KCSPEER.BOTH.IDENEQA1.TBGPASTC
//TOOLIN   DD *                             
 COPY   FROM(INDD1) TO(OUT01) USING(SRT1)   
//SRT1CNTL  DD *                                                       
  JOINKEYS F1=INDD1,FIELDS=(1,2,A)                                     
  JOINKEYS F2=INDD2,FIELDS=(1,2,A)                                     
  JOIN UNPAIRED                                                       
  REFORMAT FIELDS=(?,F1:1,207,F2:1,207)                               
  OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'1'),                       
         BUILD=(2,207)                                                 
  OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'2'),                       
         BUILD=(209,207)                                               
  OUTFIL FNAMES=OUT03,                                                 
         INCLUDE=(1,1,CH,EQ,C'B',AND,                                 
         (2,145,CH,NE,209,145,CH,OR,195,2,CH,NE,402,2,CH)), 
IFTHEN=(WHEN=(4,2,CH,NE,211,2,CH),                     
BUILD=(2,2,C'2 STC-CNY-CD'),HIT=NEXT),                 
IFTHEN=(WHEN=(6,1,CH,NE,213,1,CH),                     
BUILD=(2,2,C'3 STC-ST-TRR-CD'),HIT=NEXT),             
IFTHEN=(WHEN=(7,36,CH,NE,214,36,CH),                   
BUILD=(2,2,C'4 STC-STPV-TRR-NM'),HIT=NEXT),           
IFTHEN=(WHEN=(43,2,BI,NE,250,2,BI),                   
BUILD=(2,2,C'5 STC-STDPY-ST-NM-LEN'),HIT=NEXT),       
IFTHEN=(WHEN=(45,100,CH,NE,252,100,CH),               
BUILD=(2,2,C'6 STC-STDPY-ST-NM-TEXT'),HIT=NEXT),       
IFTHEN=(WHEN=(145,2,BI,NE,352,2,BI),                   
BUILD=(2,2,C'7 STC-DISPLAY-SEQ-NO'),HIT=NEXT),         
IFTHEN=(WHEN=(195,2,CH,NE,402,2,CH),                   
BUILD=(2,2,C'8 STC-RLUP-ST-CD'))                             


INPUT #1
Code:


 BROWSE    KCSPEER.IDEDB2U.TBGPASTC.DATAFILE.RX2000 Line 0000000000 Col 001 080
 Command ===>                                                  Scroll ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
----+----F----+----F----+----F----+----F----+----F----+----F----+----F----+----F
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 ------------------------------------------------------------------------------
********************************* Top of Data **********************************
                                                                               
                                                                               
 ------------------------------------------------------------------------------
    SDUMMY STATE-MS                      ..my test                             
4444ECEDDE4EECEC6DE4444444444444444444444019A4A8AA444444444444444444444444444444
00002444480231350420000000000000000000000084803523000000000000000000000000000000


iNPUT #2
Code:
 
Command ===>                                                  Scroll ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
----+----F----+----F----+----F----+----F----+----F----+----F----+----F----+----F
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 ------------------------------------------------------------------------------
    SDUMMY STATE                         ..                                     
4444ECEDDE4EECEC4444444444444444444444444004444444444444444444444444444444444444
000024444802313500000000000000000000000000B0000000000000000000000000000000000000


I AM GETTEING THIS AS OUTPUT
Code:

    4 STC-STPV-TRR-NM               
NH5 STC-STDPY-ST-NM-LEN           


I SHOULD GET

Code:

    4 STC-STPV-TRR-NM               
    5 STC-STDPY-ST-NM-LEN               
    6 STC-STDPY-ST-NM-TEXT
NH5 STC-STDPY-ST-NM-LEN           
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 712
Location: Maryland

PostPosted: Fri Jan 10, 2020 11:04 pm    Post subject:
Reply with quote

The BUILD parameters under IFTHEN=(…) do not create NEW records on output.
All field changes are re-BUILT within the same record, whether HIT=NEXT is used, or not.

The only way to create multiple output records from a single input is: using BUILD=(…,/,...,/,...,/,...) in OUTFIL statement
Back to top
View user's profile Send private message
speermb

New User


Joined: 27 Aug 2008
Posts: 30
Location: USA

PostPosted: Sat Jan 11, 2020 1:36 am    Post subject: Reply to: IFTHEN HIT=NEXT BUILt should create multiple recs
Reply with quote

I was basing my question on response on Is it possible to have a next line using INREC or OUTREC post from attachment
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 712
Location: Maryland

PostPosted: Sun Jan 12, 2020 9:31 pm    Post subject: Re: Reply to: IFTHEN HIT=NEXT BUILt should create multiple recs
Reply with quote

speermb wrote:
I was basing my question on response on Is it possible to have a next line using INREC or OUTREC post from attachment

I repeat once again: multiple output records from a single input record can be created ONLY when using OUTFIL BUILD=(...,/,...,/,...,/,...) statement.

Period.

If this is not clear then no one would help.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 712
Location: Maryland

PostPosted: Tue Jan 14, 2020 7:19 pm    Post subject: Re: IFTHEN HIT=NEXT BUILR should create muliple recs
Reply with quote

speermb wrote:
I am trying to get same record with different "TEXT" when a difference exists. Multiple records one for each IFTHEN=WHEN= match.


Even if one desired to help you, it is impossible to do with the post like this:

1) The given example is not working due to errors in used DDNAMEs, and others...

2) The samples of "input data" are not provided in full

3) The given code gives absolutely no clue: what is the original idea of comparison of unknown, unexplained, and not presented input fields???

4) While having no clear understanding of SORT tools functionality,
it does make sense NOT to practice on real, big and messy, input data,
but instead first to run a SIMPLIFIED test, with simple test data,
preferably truncated to 80 bytes under //INDD1 DD * , with all involved
fields in clear character format. Later, when good understanding of basic
functionality has been obtained, - to rewrite the test code using real
production data formats, etc.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 712
Location: Maryland

PostPosted: Wed Jan 15, 2020 12:25 am    Post subject:
Reply with quote

Conditional combination of various lines might work in this manner
Code:
//STEP01  EXEC PGM=ICETOOL,REGION=0M                             
. . . . . . . . . . . . . . . . . .
//INDD1    DD  DISP=SHR,DSN=KCSPEER.IDEDB2U.TBGPASTC.DATAFILE   
//INDD2    DD  DISP=SHR,DSN=KCSPEER.QA1DB2U.TBGPASTC.DATAFILE     
//OUT01    DD  DISP=SHR,DSN=KCSPEER.IDE.NOTQA1.TBGPASTC           
//OUT02    DD  DISP=SHR,DSN=KCSPEER.NOTIDE.QA1.TBGPASTC           
//OUT03    DD  DISP=SHR,DSN=KCSPEER.BOTH.IDENEQA1.TBGPASTC       
//*                                                             
//M1       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M2       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M3       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M4       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M5       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M6       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//M7       DD  UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE)               
//*                                                             
//TOOLIN   DD  *                                                 
 COPY   JKFROM                     TO(OUT01) USING(SRT1)         
 MERGE  FROM(M1,M2,M3,M4,M5,M6,M7) TO(OUT03) USING(SRT2)         
//SRT1CNTL  DD *                                                 
  JOINKEYS F1=INDD1,FIELDS=(1,2,A)                               
  JOINKEYS F2=INDD2,FIELDS=(1,2,A)                               
  JOIN UNPAIRED                                                 
  REFORMAT FIELDS=(?,F1:1,207,F2:1,207)                         
*
  INCLUDE COND=(1,1,CH,NE,C'B',                                 
             OR,2,145,CH,NE,209,145,CH,                         
             OR,195,2,CH,NE,402,2,CH)                           
*
  OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'1'),                 
         BUILD=(2,207)                                           
  OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'2'),                 
         BUILD=(209,207)                                         
  OUTFIL FNAMES=M1,                                             
         INCLUDE=(4,2,CH,NE,211,2,CH),                           
         BUILD=(2,2,C'2 STC-CNY-CD',80:X)                       
  OUTFIL FNAMES=M2,                                             
         INCLUDE=(6,1,CH,NE,213,1,CH),                           
         BUILD=(2,2,C'3 STC-ST-TRR-CD',80:X)                     
  OUTFIL FNAMES=M3,                                   
         INCLUDE=(7,36,CH,NE,214,36,CH),               
         BUILD=(2,2,C'4 STC-STPV-TRR-NM',80:X)         
  OUTFIL FNAMES=M4,                                   
         INCLUDE=(43,2,BI,NE,250,2,BI),               
         BUILD=(2,2,C'5 STC-STDPY-ST-NM-LEN',80:X)     
  OUTFIL FNAMES=M5,                                   
         INCLUDE=(45,100,CH,NE,252,100,CH),           
         BUILD=(2,2,C'6 STC-STDPY-ST-NM-TEXT',80:X)   
  OUTFIL FNAMES=M6,                                   
         INCLUDE=(145,2,BI,NE,352,2,BI),               
         BUILD=(2,2,C'7 STC-DISPLAY-SEQ-NO',80:X)     
  OUTFIL FNAMES=M7,                                   
         INCLUDE=(195,2,CH,NE,402,2,CH),               
         BUILD=(2,2,C'8 STC-RLUP-ST-CD',80:X)         
//*                                                   
//SRT2CNTL  DD *                                       
 MERGE FIELDS=(1,2,CH,A)                               
//*     

I don't want to verify the conditions; just copied from original post. Only to demonstrate the approach: how to combine various lines in any combination.

Multiple bugs in the original post are not fixed as well. Syntax errors, DD statements missing, etc.
Code:
//TOOLMSG  DD  SYSOUT=*             
//DFSMSG   DD  SYSOUT=*         
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to create UUID using COBOL PORYES COBOL Programming 0 Tue Mar 17, 2020 4:43 pm
No new posts Outrec IFTHEN builds data in wrong po... saikarthik94 DFSORT/ICETOOL 6 Sun Mar 01, 2020 2:14 pm
No new posts Create Header Dtae as MMDDYYYY thesumitk DFSORT/ICETOOL 16 Tue Feb 25, 2020 4:56 pm
No new posts Rexx to create VSAM define statements Dinesh Mani CLIST & REXX 10 Fri Nov 29, 2019 9:26 pm
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm

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