IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Comp-3 to Normal Conversion by JCL

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
View previous topic :: View next topic  
Author Message
priyesh.agrawal



Joined: 28 Mar 2005
Posts: 1509
Location: Chicago, IL

Posted: Mon Jun 06, 2005 8:25 pm    Post subject: Comp-3 to Normal Conversion by JCL  

Hi All,

Is there any JCL, can convert Comp-3 fields to Normal one.

Regards,

Priyesh.
Back to top  
Frank Yaeger



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

Posted: Mon Jun 06, 2005 9:39 pm    Post subject:  

COMP-3 fields are PD (packed decimal) fields. DFSORT can convert and edit PD fields in many ways. The exact DFSORT statement you would use depends on exactly what you mean by "normal one". For example, if you want to convert a 3-byte PD field to a 5-byte ZD field, you could use a DFSORT INREC statement like this:

Code:
   INREC FIELDS=(...,p,3,PD,TO=ZD,LENGTH=5,...)


For some more information on DFSORT's conversion functions, see:

http://www.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/online/srtmboft.html#ocv

For some more information on DFSORT's editing functions, see:

http://www.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/online/srtmboft.html

If you need more specific help on this, you need to supply more detailed information about the starting position and length of the input field, and what exactly you want the output field to look like. Also, what is the RECFM and LRECL of the input file?
Back to top  
ys_more



Joined: 21 Jun 2005
Posts: 5

Posted: Thu Aug 11, 2005 4:29 pm    Post subject:  

HI, U can also use IBEGENER utility to convert a whole record or field in a record from packed decimal(comp-3) to zoned decimal(numeric).

code sysin as

//SYSIN DD *
GENERATE MAXNAME = 1
MEMBER= (CODE THIS IF UR FILE IS PDS MEMBER GIVE MEMBER NAME NOT REQUIRED FOR SEQUENTIAL FILE)
FIELD=(LENGTH OF RECORD, 1,PZ,1)
Back to top  
kaleelahamed



Joined: 08 Jun 2006
Posts: 44
Location: Chennai

Posted: Thu Aug 30, 2007 3:57 pm    Post subject: what will happen to the sign?  

Will it be shown normally?
Back to top  
dick scherrer



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

Posted: Thu Aug 30, 2007 8:18 pm    Post subject:  

Hello,

What is this Quote: Will it be shown normally? asking?

If you clarify what you want to know, someone may have a suggestion.

Also, when you have a question, it is better to start a new topic (with complete info as to what you want to know) rather than reply to a 2-year-old topic.
Back to top  
sgaid21



Joined: 12 Sep 2006
Posts: 16
Location: Canada

Posted: Fri Aug 31, 2007 2:04 am    Post subject:  

You can use sort to do editing the PD fields as

OUTREC FIELDS=(1:1,5,PD,EDIT=(TTTTTT.TT))

Assuming PD field reserving 5 bytes and you want to see in Dec(8,2) format.

T: would show as 0 if not value in the field

I hope that would help.
Back to top  
kaleelahamed



Joined: 08 Jun 2006
Posts: 44
Location: Chennai

Posted: Fri Aug 31, 2007 10:27 am    Post subject: Reply to: Comp-3 to Normal Conversion by JCL  

Sorry For the confusion.

I wrote like,

What will happen to sign, if the COMP 3 is signed?

Will it be shown normally?

Can any one please let me know?
Back to top  
Frank Yaeger



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

Posted: Fri Aug 31, 2007 9:05 pm    Post subject:  

Quote:
What will happen to sign, if the COMP 3 is signed?

Will it be shown normally?


You keep saying "normally" without explaining what you mean by that so how do you expect us to answer you?

DFSORT has many ways to edit a PD field. There are many predefined edit masks available (M0-M26) as well as the EDIT and SIGNS parameters which let you pick your own edit mask. If you use an edit mask with a sign, then the sign will be displayed. For example:

Code:
  INREC FIELDS=(...,p,3,PD,EDIT=(STTTTT),SIGNS=(+,-))


For more information, see:

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

If you tell us what you want the output field to look like, we can tell you how to convert it.
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM