Topic
  • 5 replies
  • Latest Post - ‏2014-05-12T11:48:50Z by umareddyi
devSakthi
devSakthi
3 Posts

Pinned topic converting xml to copyBook for S9 ype

‏2013-02-23T06:17:33Z |
Hi,

I am new to wtx. I need to convert xml to copyBook. If copyBook type as S9, i have below logic should be implemented.

If xml value is -114 need to convert it to '11t'.
If '114' then 114. how we can apply this logic in typeTree or map.

-0 = p
-1 = q
-2 = r
-3 = s
...
...
...
...
...
-9=y
Thanks in advance.
Updated on 2013-02-28T15:46:47Z at 2013-02-28T15:46:47Z by N8JUC
  • N8JUC
    N8JUC
    8 Posts

    Re: converting xml to copyBook for S9 ype

    ‏2013-02-25T02:47:55Z  
    If you have a COBOL PIC S9 and no other qualification it can contain exactly one digit. You'll never fit 114 (or -114) into it. So, what's the actual declaration of the variable?
  • devSakthi
    devSakthi
    3 Posts

    Re: converting xml to copyBook for S9 ype

    ‏2013-02-25T03:12:42Z  
    • N8JUC
    • ‏2013-02-25T02:47:55Z
    If you have a COBOL PIC S9 and no other qualification it can contain exactly one digit. You'll never fit 114 (or -114) into it. So, what's the actual declaration of the variable?
    Hi John,

    The actual copyBook type i have S9(03), some elements i have S9(02)V99. But actual conversion required as
    -0 = p
    -1 = q
    -2 = r
    -3 = s
    ...
    ...
    ...
    ...
    ...
    -9=y.

    Please note, when i tried conversion in wtx, by default the typeTree created with zoned presenter, and its converting to below range,
    1230 123{
    1231 123A
    1232 123B
    1233 123C
    1234 123D
    1235 123E
    1236 123F
    1237 123G
    1238 123H
    1239 123I

    Table 2. Negative Zoned Values Integer Value sign_indicator = 0 sign_indicator = 1
    -1230 123}
    -1231 123J
    -1232 123K
    -1233 123L
    -1234 123M
    -1235 123N
    -1236 123O
    -1237 123P
    -1238 123Q
    -1239 123R
    Thanks.
  • devSakthi
    devSakthi
    3 Posts

    Re: converting xml to copyBook for S9 ype

    ‏2013-02-26T10:50:27Z  
    Hi,

    From the below link http://www.simotime.com/datazd01.htm#Table4ZDstrict, i came to know we need to convert the Zone-Decimal (strict definition) field to ASCII encoding which matches with our requirement.

    By default S9 conversion is happening for EBCDIC, how we can achieve this for ASCII conversion in wtx
  • N8JUC
    N8JUC
    8 Posts

    Re: converting xml to copyBook for S9 ype

    ‏2013-02-28T15:46:47Z  
    • devSakthi
    • ‏2013-02-26T10:50:27Z
    Hi,

    From the below link http://www.simotime.com/datazd01.htm#Table4ZDstrict, i came to know we need to convert the Zone-Decimal (strict definition) field to ASCII encoding which matches with our requirement.

    By default S9 conversion is happening for EBCDIC, how we can achieve this for ASCII conversion in wtx
    What COBOL compiler are you using? I'm not sure it makes a lot of sense to store zoned decimal on a PC. Zoned decimal works on a zSeries system because it has the hardware instructions to take advantage of it. A PC, or most UNIX systems that I'm aware of.
    You may need to open a PMR to address this problem.

    Good Luck
  • umareddyi
    umareddyi
    1 Post

    Re: converting xml to copyBook for S9 ype

    ‏2014-05-12T11:48:50Z  
    • N8JUC
    • ‏2013-02-28T15:46:47Z
    What COBOL compiler are you using? I'm not sure it makes a lot of sense to store zoned decimal on a PC. Zoned decimal works on a zSeries system because it has the hardware instructions to take advantage of it. A PC, or most UNIX systems that I'm aware of.
    You may need to open a PMR to address this problem.

    Good Luck

    Hi Dev,

    I am facing the same problem now. I need to convert the my xml data to suport the cobol copy book as you specified above. For Ex: 1230 123{
    1231 123A. i am trying to achieve using osb now, but i am not able to convert like this. you have already faced the same scenario. can you please tell me how to solve this. can i have sample code snipet. can anyone help me..

    Thanks