Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
changing datatype of a field from COMP-3 to DISPLAY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
NB Gautam

New User


Joined: 29 Aug 2008
Posts: 8
Location: bhubaneswar

PostPosted: Sat Aug 30, 2008 9:21 pm    Post subject: changing datatype of a field from COMP-3 to DISPLAY
Reply with quote

Hi All,

I have a file with few fields having COMP-3 usage.
Now I need to change the usage from COMP-3 to DISPLAY. I can very well do through COBOL but i need to do through JCL. Is there any JCL utilitiy to do this job.

can anyone help?
Back to top
View user's profile Send private message
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4579
Location: San Jose, CA

PostPosted: Sat Aug 30, 2008 9:29 pm    Post subject:
Reply with quote

COMP-3 is equivalent to DFSORT's PD format. DISPLAY is equivalent to DFSORT's ZD format. See:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603

You can convert from PD to ZD with DFSORT statements like this:

Code:

    OPTION COPY
    INREC BUILD=(...,p,m,PD,TO=ZD,LENGTH=n,...)


See the following for more information on conversion:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822

If you need more specific help, give more specific information about your input fields and expected output fields.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 989
Location: Virginia, USA

PostPosted: Sat Aug 30, 2008 10:15 pm    Post subject:
Reply with quote

Why do you think you need to change these fields?
Back to top
View user's profile Send private message
NB Gautam

New User


Joined: 29 Aug 2008
Posts: 8
Location: bhubaneswar

PostPosted: Sat Aug 30, 2008 11:03 pm    Post subject:
Reply with quote

Hi Crag,
Actually i am using FILEAID to see the data of a file. But since there are some fields which are in COMP-3 format so i am unable the content properly. so i wanted to convert them in display format.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8643
Location: 221 B Baker St

PostPosted: Sat Aug 30, 2008 11:29 pm    Post subject:
Reply with quote

Hello,

To be able to "see" the data, use HEX ON.

It will save copying the file to merely reformat some field(s).
Back to top
View user's profile Send private message
NB Gautam

New User


Joined: 29 Aug 2008
Posts: 8
Location: bhubaneswar

PostPosted: Sun Aug 31, 2008 11:03 pm    Post subject:
Reply with quote

Hi dick,
Thanks . I will use 'hex on' for seeing reformated data. Can i save reformated whole data as a different dataset so that i can downoad that new content from mainfraeme server to local PC.
Back to top
View user's profile Send private message
NB Gautam

New User


Joined: 29 Aug 2008
Posts: 8
Location: bhubaneswar

PostPosted: Sun Aug 31, 2008 11:55 pm    Post subject: Reply to: changing datatype of a field from COMP-3 to DISPL
Reply with quote

Hi frank,
Thanks for sending link. I read the document specified in Link.

Suppose there is one variable defined as
WS-VAR1 PIC 9(11) COMP-3

So what will be JCL statement syntax to convert them in DISPLAY format.
I want it in more detail.
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8643
Location: 221 B Baker St

PostPosted: Mon Sep 01, 2008 4:52 am    Post subject:
Reply with quote

Hello,

Now that we understand what you really need to do, yes, you need to convert the data.

I believe zoned decimal will not work for you as the pc will not handle the "zone". . .

You need to reformat the data so that a negative is a minus sign rather than a zoned sign.

Look at this previous topic that does the same thing you need to do:
http://ibmmainframes.com/viewtopic.php?t=31302
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4579
Location: San Jose, CA

PostPosted: Mon Sep 01, 2008 10:15 pm    Post subject:
Reply with quote

Quote:
Suppose there is one variable defined as
WS-VAR1 PIC 9(11) COMP-3

So what will be JCL statement syntax to convert them in DISPLAY format.


That would be a 6-byte PD field starting at position 1. If you want to convert it to an 11-byte ZD field you could use these DFSORT statements:

Code:

   OPTION COPY
   INREC BUILD=(1,6,PD,TO=ZD,LENGTH=11)


If you want to convert it to a value with blank for a positive sign and - for a negative sign and leading zeros suppressed, you could use these DFSORT statements:

Code:

   OPTION COPY
   INREC BUILD=(1,6,PD,TO=FS,LENGTH=12)



If you want the output in some other form, show what you want it to look like for +1, -1, +12345678901 and -12345678901.
Back to top
View user's profile Send private message
NB Gautam

New User


Joined: 29 Aug 2008
Posts: 8
Location: bhubaneswar

PostPosted: Thu Sep 04, 2008 4:21 pm    Post subject: Reply to: changing datatype of a field from COMP-3 to DISPL
Reply with quote

HI All,
Thanks a lot. I got solution for the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1