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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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