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

Using ICETOOL to populate an output field with derived value


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

New User


Joined: 24 Feb 2010
Posts: 3
Location: Colleyville, TX

PostPosted: Thu Feb 25, 2010 7:42 pm
Reply with quote

I've built an ICETOOL job to overlay an offset in a VB file with a
literal. This works great. I also have another requirement to place
a derived value at another offset in the output file. Can ICETOOL do
this?

Here are the requirements...

Code:
 SORT
FIELDS=(5,28,BI,A)
 RECORD
TYPE=VB
 OPTION
COPY
 OUTREC IFTHEN=(WHEN=(5,4,BI,NE,X'4B4B4B4B',AND,
9,4,BI,GT,X'00000000',
             AND,13,1,BI,EQ,X'20',AND,
19,8,BI,EQ,X'4040404040404040'),
       OVERLAY=(19:C'JUNKSITE'))

----+----1----+----2----+----3----+----4-
 ----------------------------------------
JEFF.........!        98103107592300.....
DCCC000220000544444444FFFFFFFFFFFFFF00000
1566000F00003A000000009810310759230000000


The ICETOOL control cards above will identify this record, and overlay
column 15 with JUNKSITE.

I also need to populate offset 841 with a derived name, using this
model.

PWC.aaaa.#nnnnnnn.N

where aaaa = columns 1-4 (JEFF in this example)
nnnnnnn = the decimal translation of the binary value stored in
columns 5-8 (in this example x'0000002F' = decimal 0000047.

So the derived name that I want to place at offset 841 is

PWC.JEFF.#0000047.N

Any help you can provide is appreciated.

Thanks,
Jeff Jones
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Feb 25, 2010 11:54 pm
Reply with quote

Jeff Jones,

You can use the following control cards. I modified your control cards to be more readable and easier to modify

Code:

//SYSIN  DD *
  SORT FIELDS=(5,28,BI,A)
  RECORD TYPE=VB
  OUTREC IFTHEN=(WHEN=(05,4,BI,NE,X'4B4B4B4B',AND,
                       09,4,BI,GT,X'00000000',AND,
                       13,1,BI,EQ,X'20',AND,
                       19,8,BI,EQ,X'4040404040404040'),
       OVERLAY=(19:C'JUNKSITE'),HIT=NEXT),

  IFTHEN=(WHEN=(05,4,CH,EQ,C'JEFF',AND,
                09,4,BI,GT,X'0000002F'),
  OVERLAY=(841:C'some value'))
//*
Back to top
View user's profile Send private message
JeffJones

New User


Joined: 24 Feb 2010
Posts: 3
Location: Colleyville, TX

PostPosted: Fri Feb 26, 2010 10:57 pm
Reply with quote

Thanks for your reply SKolusu. I've gotten further, but am still struggling with converting a binary value to the decimal equivalent in the output record. Here's what I have in the input file.
Code:

----+----1----+----2----+----3----+----4-
 ----------------------------------------
JEFF.........!        98103107592300.....
DCCC000220000544444444FFFFFFFFFFFFFF00000
1566000F00003A000000009810310759230000000


I want to convert the binary value in columns 5-8 to decimal and overlay that value at offset 855. Using the parse command, I can get halfway there. I need to translate %02 from 0000002F to 0000047.

Code:

SORT FIELDS=(5,28,BI,A)                               
RECORD TYPE=VB                                       
OPTION COPY                                           
OUTREC IFTHEN=(WHEN=(05,4,BI,NE,X'4B4B4B4B',AND,     
                     09,4,BI,GT,X'00000000',AND,     
                     13,1,BI,EQ,X'20',AND,           
                     19,8,BI,EQ,X'4040404040404040'),
       PARSE=(%01=(ABSPOS=5,FIXLEN=4),               
              %02=(ABSPOS=9,FIXLEN=4)),               
       OVERLAY=(19:C'JUNKSITE',                       
                845:C'PWC.',                         
                849:%01,                             
                853:C'.#',                           
                855:%02,                             
                863:C'.N             '))             



The results of the above sysin look like this in the output record.

The JUNKSITE overlay is good.
Code:

----+----1----+----2----+----3----+--
 ------------------------------------
JEFF.........!JUNKSITE98103107592300.
DCCC0002200005DEDDECECFFFFFFFFFFFFFF0
1566000F00003A14522935981031075923000


Overlay beginning at offset 841 is good except for the binary to decimal translation.
Code:

4----+----5----+----6----+----7----
 ----------------------------------
.PWC.JEFF.#.....   .N             
0DEC4DCCC47000244444D4444444444444
0763B1566BB000FB000B50000000000000


Thanks,
Jeff
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: Fri Feb 26, 2010 11:31 pm
Reply with quote

Code:

...
  855:%02,BI,TO=ZD,LENGTH=7,
...


I answered your question about this on ibm-main also.

I don't really understand why you're using PARSE here. It doesn't seem like you need it since the fields are fixed, not delimited. You could just use 5,4 instead of %01 and 9,4 instead of %02.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Feb 26, 2010 11:36 pm
Reply with quote

Jeff,

You really don't need a parse statement there , you can simply convert the binary value to Zoned decimal format

use the following control cards

Code:

SORT FIELDS=(5,28,BI,A)                               
RECORD TYPE=VB                                       
OPTION COPY                                           
OUTREC IFTHEN=(WHEN=(05,4,BI,NE,X'4B4B4B4B',AND,     
                     09,4,BI,GT,X'00000000',AND,     
                     13,1,BI,EQ,X'20',AND,           
                     19,8,BI,EQ,X'4040404040404040'),
     OVERLAY=(19:C'JUNKSITE',                       
                845:C'PWC.',                         
                849:5,4,
                853:C'.#',                           
                855:9,4,BI,ZD,LENGTH=7,
                863:C'.N             '))
Back to top
View user's profile Send private message
JeffJones

New User


Joined: 24 Feb 2010
Posts: 3
Location: Colleyville, TX

PostPosted: Sat Feb 27, 2010 3:04 am
Reply with quote

Thanks Frank and Skolusu. To answer your question about why I'm using PARSE, I didn't know any better. I was looking for some opportunity to solve my problem and ran across PARSE. Akin to over-egging the cake.

Thanks for your help.

Jeff
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top