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

ICETOOL overlay for some characters


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

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Jul 15, 2008 3:45 am
Reply with quote

I have a FB/17 I/P file that looks like
Code:
----+----1----+----2
CSE00641LT123ARP1
CSE00642LT123ARP1
CSE00643LT123ARP1
CSE00644LT123ARP1
CSE04011LT456ARP1
CSE04011LT457ARP1
CSE00641LT124ARP2
CSE00642LT124ARP2
CSE00643LT124ARP2
CSE00644LT124ARP2
CSE04011LT454ARP2
CSE04011LT458ARP2
CSE04011LT459ARP2
CSE04011LT450ARP2
CSE04011LT451ARP2


and my o/p file should look like
Code:
----+----1----+----2
CSE00641LT123ARP1   
CSE00642LT123ARP1   
CSE00643LT123ARP1   
CSE00644LT123ARP1   
CSE00645LT123ARP1   
CSE00645LT123ARP1   
CSE00641LT124ARP2   
CSE00642LT124ARP2   
CSE00643LT124ARP2   
CSE00644LT124ARP2   
CSE00645LT124ARP2   
CSE00645LT124ARP2   
CSE00645LT124ARP2   
CSE00645LT124ARP2   
CSE00645LT124ARP2   


My requirement is I have to overlay the 9,5 chars from 'CSE00641' record to 'CSE04011' record and then convert all the 'CSE04011' to 'CSE00645'. Can this be accomplished in dfsort?
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: Tue Jul 15, 2008 4:18 am
Reply with quote

Huh? Your explanation makes no sense and doesn't match your input/output.

For example, I see the following in positions 1-8 in your fifth input record:

CSE0401I

and the following in positions 1-8 in your fifth output record:

CSE00645

If you said you wanted to change 'CSE0401I' in positions 1-8 to 'CSE0645', that would make sense.

But instead you say you want to "overlay the 9,5 chars from 'CSE00641' record to 'CSE04011' record and then convert all the 'CSE04011' to 'CSE00645'". How does that relate to the input and output you show? What is 9,5? Why would you want to do a double conversion instead of a single conversion? I don't see any change to the 'CSE00641' input records.

I can show you how to do what you want to do with DFSORT, but first you have to do a better job of explaining what you want to do in terms of an example of input and output that makes sense.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Jul 15, 2008 5:29 am
Reply with quote

I was in a hurry so didn't do a good job of explaining what I want. I will rephrase my requirements.
There will be only one 'CSE00641' (1,8) for each 'ARP1' (14,4). But there can be more than one 'CSE04011' (1,8) for each 'ARP1' (14,4).

1) By "overlay the 9,5 chars from 'CSE00641' record to 'CSE04011' record" I meant, if (1,8) is 'CSE00641' copy (9,5) from this record and paste it to (9,5) in record where (1,8) is 'CSE04011', for the corresponding 14,4 (ARP1).

2) The next requirement is to change all 'CSE04011' to 'CSE00645' in (1,8).

Please let me know if I didn't make myself clear.
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: Tue Jul 15, 2008 9:38 pm
Reply with quote

Yes, that's more clear.

However, it appears that each group of records starts with a CSE0641 record and you want to propagate the LTx value from that record to the rest of the records in the group. Is that true? Or is it possible that another record of the group (e.g. CSE0642) would have a different LTx value than the CSE0641 record for that group? Propagating the LTx value to each record of the group and changing each CSE0411 to CSE00645 would be easier than what you described.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Tue Jul 15, 2008 9:54 pm
Reply with quote

You are right CSE00641 will not have a different LTX than CSE00642,3,4 with in the same group of (14,4). You restated the requirement exactly as I wanted but more clearly.
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: Tue Jul 15, 2008 10:02 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/17)
//OUT DD DSN=...  output file (FB/17)
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,ZD) KEEPBASE -
  WITHALL WITH(1,8) WITH(12,6) USING(CTL1)
/*
//CTL1CNTL DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(18:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,8,CH,EQ,C'CSE00641'),
                OVERLAY=(18:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(26:SEQNUM,8,ZD,
                         18:18,8,ZD,SUB,26,8,ZD,TO=ZD,LENGTH=8))
  OUTFIL FNAMES=OUT,
    IFOUTLEN=17,
    IFTHEN=(WHEN=(1,8,CH,EQ,C'CSE04011'),OVERLAY=(1:C'CSE00645'))
/*
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Fri Jul 18, 2008 5:49 pm
Reply with quote

Thanks, this helped a lot. I really appreciate your time.
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 Aug 06, 2008 5:16 am
Reply with quote

You can now do this more easily and efficiently with DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//S1   EXEC  PGM=ICEMAN
//SYSOUT   DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/17)
//SORTOUT DD DSN=...  output file (FB/17)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
          BEGIN=(1,8,CH,EQ,C'CSE00641'),PUSH=(9:9,3))
  OUTFIL IFOUTLEN=17,
    IFTHEN=(WHEN=(1,8,CH,EQ,C'CSE04011'),OVERLAY=(1:C'CSE00645'))
/*


For complete details on the new WHEN=GROUP function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
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 Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top