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

Data type conversion


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

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Aug 25, 2010 2:11 pm
Reply with quote

My file lrecl=60
in that
position 1 to 15 have alphanumeric key value
position 16 to 22 have comp-3 value
position 37 to 39
position 40 t0 43

How can i convert this comp-3 value into normal format ie ZD?

is my following code is correct for first value position from 16 to 22?

Code:

//SORT1    EXEC PGM=SORT                       
//SORTIN   DD DSN=Y000263.RMSFEED.FILE1,DISP=SHR
//SORTOUT  DD DSN=Y000263.QTRAN.RTK14,         
//            UNIT=DATA,DISP=(,CATLG,DELETE),   
//            SPACE=(CYL,(500,50),RLSE)
//SYSOUT   DD SYSOUT=*                         
//SYSIN    DD *                                 
   SORT FIELDS=(1,15,CH,A)                     
   OUTREC FIELDS=(15:16,7,PD,TO=ZD,LENGTH=7)   
/*                                             
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 25, 2010 7:30 pm
Reply with quote

Hello,

What happens when you run this?

If you haven't, why not?

You are your own best resource when working thru something like this icon_wink.gif
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Aug 25, 2010 9:10 pm
Reply with quote

wouldnt ur data get truncated ????????

and wats would be the point i having the data without the Key ???
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 Aug 25, 2010 11:04 pm
Reply with quote

Quote:
position 16 to 22 have comp-3 value


That's a 7-byte PD field so it can have 13 digits. As smijoss indicated, using LENGTH=7 can result in truncation since the output field will only have the last 7 digits of the 13 digits. If you want all of the digits, use LENGTH=13 (or don't use LENGTH and DFSORT will use the correct length automatically).
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 Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top