Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 & VSAM
View previous topic :: :: View next topic  
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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
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: 1512
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

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: 7130
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
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

PostPosted: Thu Mar 15, 2012 4:36 pm    Post subject: Reply to: changing datatype of a field from COMP-3 to DISPL
Reply with quote

Thanks Frank for your solution
Back to top
View user's profile Send private message
ChowHan

New User


Joined: 16 Oct 2009
Posts: 15
Location: India

PostPosted: Fri Mar 16, 2012 10:20 pm    Post subject:
Reply with quote

Err.... you could use the print option in fileaid menu to print this file to a dataset, provided the file does not have occurs depending on or redefines clause... That is ... if this is for a one time use (validation purposes) that way you will get field names as a header as well and you wouldn't have to create a header and this would be easily ported to a spreadsheet . But since you have already decided on a solution so be it...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us