|
View previous topic :: View next topic
|
| Author |
Message |
JeffJones
New User
Joined: 24 Feb 2010 Posts: 3 Location: Colleyville, TX
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
JeffJones
New User
Joined: 24 Feb 2010 Posts: 3 Location: Colleyville, TX
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
 |
JeffJones
New User
Joined: 24 Feb 2010 Posts: 3 Location: Colleyville, TX
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|