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

Converting PD to ZD


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Mon Feb 11, 2008 6:29 pm
Reply with quote

I am trying to convert a Packed Decimal field into a Zoned Decimal field. The picture clause of the field is S9(15) COMP-3. I want extract only the first 9 bytesof the field using OUTREC. How do i go about it?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Mon Feb 11, 2008 6:45 pm
Reply with quote

suzeet wrote:
I am trying to convert a Packed Decimal field into a Zoned Decimal field. The picture clause of the field is S9(15) COMP-3. I want extract only the first 9 bytesof the field using OUTREC. How do i go about it?


S9(15) comp-3 is only 8 bytes so you will have a hard time extracting only the first 9 bytes. Do you mean that your want only the first 9 (leftmost) digits or the last 9 (rightmost digits)? if the field has a value of 000000123456789, do you want 000000123 or 123456789 and what about the sign?
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed Feb 13, 2008 3:18 pm
Reply with quote

I don't want the sign field. I want only first 9 digit (leftmost)
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Feb 13, 2008 4:42 pm
Reply with quote

Hi suzeet,

Let us assume your S9(15) COMP-3 field is in position 1 and length 8 in a file.

Please check with the following code for your requirement.
Code:
// EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INFILE,DISP=SHR
//SORTOUT DD DSN=OUTFILE,...
//SYSIN DD *
 OPTION COPY
 INREC BUILD=(1,8,PD,EDIT=(TTTTTTTTTTTTTTT))
 OUTREC BUILD=(1,9)
/*

Thanks,
Shankar
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Feb 13, 2008 10:14 pm
Reply with quote

Here's a couple of ways to do it with DFSORT using just an INREC statement:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,8,PD,DIV,+1000000,M11,LENGTH=9)
/*


Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,8,PD,M11)),
        IFTHEN=(WHEN=INIT, BUILD=(1,9))
/*

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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts Converting unpacked fields to pack us... SYNCSORT 4
Search our Forums:

Back to Top