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

Moving a PD to PD


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Oct 07, 2016 9:59 pm
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
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Fri Oct 07, 2016 10:06 pm
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: 446
Location: USA

PostPosted: Sat Oct 08, 2016 12:36 am
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: 2481
Location: @my desk

PostPosted: Sat Oct 08, 2016 12:51 am
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
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Oct 08, 2016 2:25 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Oct 08, 2016 1:19 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts Moving a COMP-3 Variable to a Numeric... COBOL Programming 2
No new posts Moving a PS file as body of a mail! JCL & VSAM 4
No new posts Moving UDB database to Db2 on z/OS DB2 4
No new posts Moving values to a variable of copybo... COBOL Programming 6
Search our Forums:

Back to Top