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
 

 

Data type conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Data type conversion
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

Site Director


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

PostPosted: Wed Aug 25, 2010 7:30 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Aug 25, 2010 11:04 pm    Post subject:
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    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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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