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

converting BI to ZD


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Thu Jul 15, 2021 7:06 pm
Reply with quote

Hi,

let me explain my question,

i have a COMP S9(9) length-4 value -803 . now i have convert this comp variable to character ZD.

My Expected output:
is same as above i/p value -803


Code:


Code:
  OUTREC FIELDS=(79,4,FI,TO=ZDF)



but, i'm getting this as output - 000000080L

kindly let me know, what to do and move further

thanks in advance
Code'd for you
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2146
Location: USA

PostPosted: Thu Jul 15, 2021 7:26 pm
Reply with quote

0) there is no such format in COBOL - “S9(9) length-4”

1) learn how to use code tags in your post

2) how do you expect the value (F’-803’ in Assembler) to look like after TO=ZDF - ???

3) read the SORT manual about the conversion TO=ZDF. You’ve got exactly what is described.

4) why not to run several tests with several options and values, to find out by yourself: what is wrong in your mind?
Back to top
View user's profile Send private message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Thu Jul 15, 2021 7:50 pm
Reply with quote

Hi Sergeyken,

the field name contains picture of S9(9) COMP. , its length is 4 and it contains value -803.

this field have to be converted from comp to character
For this first I have coded as ,


Code:


OUTREC FIELDS=(79,4,BI,TO=ZD,LENGTH=9)



OUTPUT -

Code:


294966493


Quote:

Then I have used FI instead of BI
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2146
Location: USA

PostPosted: Thu Jul 15, 2021 7:54 pm
Reply with quote

I see, you refuse to read the SORT manual about TO=ZDF… icon_cry.gif

Using BI instead of FI demonstrates that you did not read about those values, too icon_cry.gif icon_cry.gif

Hint: use parameter EDIT=(…), or Mxx - whatever you prefer

Try to run different tests with different values, and different options, to train your mind in understanding the whole picture
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jul 15, 2021 9:07 pm
Reply with quote

This is a very basic question and discussed several times on this board , please learn to use SEARCH to find relevant topics then try and if doesn't work then post back with sample data , errors , code which you tried.
ibmmainframes.com/about34882.html
ibmmainframes.com/about46967.html
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2146
Location: USA

PostPosted: Thu Jul 15, 2021 11:31 pm
Reply with quote

Nowadays, any admonition to begin learning something does not help...
Without a ready-to-use answer there is not a minor step forward icon_evil.gif

First of all, one needs to understand well the existing data formats, and the rules of their conversion. Something like this example:
Code:
Value:                           ~~~ 803 ~~~       ~~~ -803 ~~~
COBOL:          PIC S(9)9 COMP   VALUE 803         VALUE -803
Assembler:                       DC F'803'         DC F'-803'
Hex:                             X'00000323'       X'FFFFFCDD'
Packed Dec:                      X'000000803C'     X'000000803D'
Unpacked Dec:                    X'...F0F8F0C3'    X'...F0F8F0D3'
TO=ZD                            C'000000080C'     C'000000080L'
TO=ZDC                           C'000000080C'     C'000000080L'
TO=ZDF                           C'0000000803'     C'000000080L'
EDIT=(STTT),SIGNS=(+,-)          C'+803'           C'-803'
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 -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts IBM HPU 5.2 - Converting EBCDIC Chara... DB2 0
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Converting fixed length file to excel... IBM Tools 7
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Converting S9(18) value to a decimal ... DFSORT/ICETOOL 6
Search our Forums:

Back to Top