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
 

 

Moving a PD to PD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
spoorni

New User


Joined: 29 Nov 2007
Posts: 20
Location: india

PostPosted: Fri Oct 07, 2016 9:52 pm    Post subject: Moving a PD to PD
Reply with quote

I am trying to move a field which is of PD and length 6 bytes to a field which is also a PD and a length of 9 bytes. If i do a straight move, the field is getting populated with junk values. If i move, zeroes to the first 3 bytes of the output and then the field, it still has junk values. I am using OUTREC to perform this operation. Could anyone provide any pointers?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Oct 07, 2016 9:59 pm    Post subject:
Reply with quote

Why did you not post some sample input and output data? And, by the way, there is no such thing as "junk values" -- the values may not be human-readable, but they are values from the collating sequence and as such may require interpretation, but they are NOT "junk".

Is the data set fixed length or variable length? If variable length, did you account for the RDW in your OUTREC positions?
Back to top
View user's profile Send private message
spoorni

New User


Joined: 29 Nov 2007
Posts: 20
Location: india

PostPosted: Fri Oct 07, 2016 10:03 pm    Post subject: Reply to: Moving a PD to PD
Reply with quote

The input and output are both fixed length files. The input is an unload from a DB2 table. In the table the column is of DECIMAL type and length of 11. The output is a fixed length file and the field is of type S9(16)V COMP-3.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Oct 07, 2016 10:06 pm    Post subject:
Reply with quote

Why don't you fix the source (the select query by using CAST function)?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Sat Oct 08, 2016 12:36 am    Post subject: Re: Moving a PD to PD
Reply with quote

spoorni wrote:
If i do a straight move, the field is getting populated with junk values.

Do some twisted moves instead. icon_evil.gif

.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Sat Oct 08, 2016 12:51 am    Post subject: Re: Moving a PD to PD
Reply with quote

RahulG31 wrote:
Do some twisted moves instead. icon_evil.gif .
spoorni wrote:
If i move, zeroes to the first 3 bytes of the output and then the field, it still has junk values.
There was an attempt at that too icon_smile.gif
Back to top
View user's profile Send private message
spoorni

New User


Joined: 29 Nov 2007
Posts: 20
Location: india

PostPosted: Sat Oct 08, 2016 2:19 am    Post subject:
Reply with quote

How would I use CAST in this case? I tried a few options but were not fruitful.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Sat Oct 08, 2016 2:25 am    Post subject:
Reply with quote

Code:
select cast( your_column_name as DEC(16,0) )from sysibm.sysdummy1
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Sat Oct 08, 2016 1:19 pm    Post subject: Reply to: Moving a PD to PD
Reply with quote

There are zeros, and zeros. To create your longer packed-decimal, use binary zeros.

...,3Z,sourcestart,sourcelength...
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 Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am
No new posts MOVING COMP-3 into binary akodakka COBOL Programming 2 Tue Dec 01, 2015 5:02 pm
No new posts CICS- Moving to High availability vicky10001 CICS 8 Fri Oct 23, 2015 7:49 pm
No new posts What is the best way for moving from ... Hooman24 All Other Mainframe Topics 0 Sun Apr 26, 2015 6:36 pm
No new posts Moving codein Natural development System Ashish.Srivastava.123 Java & MQSeries 2 Mon Feb 02, 2015 10:18 pm


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