Regards,
Vinoth Thiyagarajan
Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mail...@wipro.com immediately
and destroy all copies of this message and any attachments.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
> Can anyone tell me how to convert a file with COMP fields to a normal
> file. I will be pleased if anyone gives me the JCL for that.
>
>
> Regards,
> Vinoth Thiyagarajan
>
>
IEBPTPCH can probably do what you want.. Its documented in the MVS Utilities
manual.
Ed
I hope the below jcl will suit your need . This will work if u have
dfsort installed , if u have syncsort installed pls do change the program
to synctool.
//STEP EXEC PGM=ICETOOL
//TOOLIN DD *
COPY FROM(IN01) TO(OT01) USING(CPY1)
/*
//IN01 DD DISP=SHR,DSN=your 100 byte input dataset
//OT01 DD DSN=your O/P file
//CPY1CNTL DD *
OUTFIL FNAMES=OT01,
OUTREC=(1,2,PD, PD FIELD STARTS AT 01, LENGTH 02
TO=ZD, CONVERT TO ZD OR UNPACK IT
3,8, KEEP THESE FIELDS AS IS
10,7,PD, PD FIELD STARTS AT 10, LENGTH 07
TO=ZD, CONVERT TO ZD OR UNPACK IT
17,34, KEEP THESE FIELDS AS IS
50,3,PD, PD FIELD STARTS AT 50, LENGTH 03
TO=ZD, CONVERT TO ZD OR UNPACK IT
53,48) KEEP THESE FIELDS AS IS
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
Thanks&Regards,
Rajeev Vasudevan
IBM Global Services India Pvt. Ltd
Embassy Golf Links,Off Indg- Kmg Intermediate Ring Road
Bangalore - 560 071, India
Ph:+91-80-25358020 Extn.6835
Dir:+91-80-51056835
Fax :+91-80-25358030
E-mail : rvas...@in.ibm.com
"The illiterates of the future are not those who can not read or write,
but those who can not learn, unlearn and relearn." - Alvin Toffler
Regards,
Vinoth Thiyagarajan
Confidentiality Notice
The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mail...@wipro.com immediately
and destroy all copies of this message and any attachments.
----------------------------------------------------------------------
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer
OUTREC=(1,2,PD, PD FIELD STARTS AT 01, LENGTH 02
TO=ZD) CONVERT TO ZD OR UNPACK IT
This can be used to convert packed decimal (COMP-3) to zoned decimal. You
can use BI instead of PD to convert COMP fields into zoned decimal.
Alternatively you can use the conversion functions (X2D etc ..) and SUBSTR
in REXX but you have to write an EXEC for that
Hello,
Thanks&Regards,
----------------------------------------------------------------------
This can be used to convert packed decimal (COMP-3) to zoned decimal. You
can use BI instead of PD to convert COMP fields into zoned decimal.
Alternatively you can use the conversion functions (X2D etc ..) and SUBSTR
in REXX but you have to write an EXEC for that. You can use the folloing
exec as base
/*-----------REXX-------------------------------------*
* *
* Author. . . .: Mayakkannan.S *
* Module. . . .: CVTDATA *
* Function. . .: This exec will convert decimal *
* and binary values in a file to *
* displayable format (COMP /COMP-3 *
* to DISPLAY). *
* Parameters. .: customize it according to ur data*
* *
*----------------------------------------------------*/
infile = 'your.dsn'
drop instem.
/*------------------------------------------------------*
* File Layout *
*------------------------------------------------------*
* Position | Length | Datatype *
*------------------------------------------------------*
* 1 - 2 | 2 | Comp-3 (Packed Decimal) *
* 3 - 10 | 8 | Alphanumeric *
* 11- 2 | 2 | Comp (Zoned Decimal) *
*------------------------------------------------------*/
Address tso "alloc fi(indd) da('"infile"') shr reuse"
Address tso "execio * diskr indd(stem instem. finis"
Address tso "free fi(indd)"
do i = 1 to instem.0
x = c2x(substr(instem.i,1,2))
select
when substr(x,length(x),1) == 'A' then x = '+' || x
when substr(x,length(x),1) == 'B' then x = '-' || x
when substr(x,length(x),1) == 'C' then x = '+' || x
when substr(x,length(x),1) == 'D' then x = '-' || x
when substr(x,length(x),1) == 'E' then x = '+' || x
otherwise x = x
end
say substr(x,length(x),1)
x = substr(x,1,length(x)-1)
x = substr(x,1,length(x)-1)
x = x ||,
substr(instem.i,3,8) ||,
x2d(c2x(strip(substr(instem.i,11,2))))
Say x
end
exit
Disclaimer:
This message and any attachment(s) contained here are information that is
confidential, proprietary to HCL Technologies and its customers. Contents
may be privileged or otherwise protected by law. The information is solely
intended for the individual or the entity it is addressed to. If you are not
the intended recipient of this message, you are not authorized to read,
forward, print, retain, copy or disseminate this message or any part of it.
If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer
----------------------------------------------------------------------
Depending on what you mean by "normal file", the OUTFIL OUTREC statement of
DFSORT might be the simplest.
-jc-
Vinoth Thiyagarajan wrote:
>Can anyone tell me how to convert a file with COMP fields to a normal
>file. I will be pleased if anyone gives me the JCL for that.
You can use the INREC, OUTREC or OUTFIL statement of DFSORT to convert from
one field format to another.
See the following for more information on the equivalent DFSORT formats for
various COBOL data types:
http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmacfm.html
See the following for information on using DFSORT to convert between
different formats:
http://www.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/online/srtmboft.html#ocv
Frank Yaeger - DFSORT Team (IBM)
Specialties: ICETOOL, IFTHEN, OVERLAY, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
If you have a copylib file with COMP definitions, you can EASILY create a
COBOL program to create an output file - using COPY/REPLACING to define
fields and converting various (COMP, COMP-3, BINARY, PACKED-DECIMAL, etc)
fields to USAGE DISPLAY SIGN IS SEPARATE.
any experienced COBOL programmer can create such a program in about half an
hour!
<vinoth.th...@ibm-main.lst> wrote in message
news:<8990B2231BBA4C45A11...@BLR-EC-2K3MSG.wipro.com>...
> Can anyone tell me how to convert a file with COMP fields to a normal
> file. I will be pleased if anyone gives me the JCL for that.
>
>
----------------------------------------------------------------------
Let me jump in and say, that if you have File-Aid MVS you would be able to
do it in less then 5 minutes with the reformat option.
Sorry for the 'commercial' ;-)
Robert Galambos
Compuware Senior Technical Specialist
IBM Certified Solutions Expert -
DB2 UDB for OS/390 V7 Database Administration
robert....@compuware.com
Tel: +1 905 803 8600
Toll Free: +1 800 348 8299
Fax: +1 905 803 8603
Quebec: +1 877-281-1888
Compuware Canada
Service is our best product
Les renseignements contenus dans le présent message électronique sont
confidentiels et concernent exclusivement le(s) destinataire(s) désigné(s).
Il est strictement interdit de distribuer ou de copier ce message. Si vous
avez reçu ce message par erreur, veuillez répondre par courriel à
l'expéditeur et effacer ou détruire toutes les copies du présent message.
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.