Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Converting PD to ZD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Converting PD to ZD
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    Post subject: Re: Converting PD to ZD
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    Post subject: Reply to: Converting PD to ZD
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    Post subject:
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 Moderator


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

PostPosted: Wed Feb 13, 2008 10:14 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us