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 Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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