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
 

 

to sort out various datatypes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
janani vs

New User


Joined: 01 Sep 2009
Posts: 15
Location: CHENNAI

PostPosted: Wed Sep 30, 2009 6:28 pm    Post subject: to sort out various datatypes
Reply with quote

I have a job which copies contents from input file & writes into output file, but the contents in input file are of different datatypes(CHARACTER,BINARY)........


input file :
col 1 to col 4 character
col 5 to col 9 binary

output file should be like

col 1 to col 4 character( as it is in input file)
col 5 to col 9 as zoned decimal or charater


I tried this:
Code:

//SORT  EXEC PGM=SORT
//SYSOUT DD SYSOUT=*                               
//SORTIN DD DSN=XXX.INPUT,DISP=SHR                   
//SORTOUT DD DSN=XXX.OUTPUT,       
//           DISP=SHR                               
//SYSIN DD *                                       
  OPTION COPY             
  OUTREC FIELDS=((1,4,CH),TO=CH,LENGTH=4,(5,4,BI),TO=ZD,LENGTH=4)
/*


But I'm getting error "operand defined error"
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 Sep 30, 2009 9:17 pm    Post subject:
Reply with quote

You can't just make up your own syntax and expect it to work. You have to use the syntax actually defined by DFSORT.

You say "col 5 to col 9 binary" which would be 5 bytes, but then you use 4 bytes for the BI field, so I'll assume it's actually 4 bytes. If so, you can use these DFSORT control statements:

Code:

    OPTION COPY
    OUTREC OVERLAY=(5:5,4,BI,TO=ZD,LENGTH=4)


However, keep in mind that the maximum 4-byte BI value is 4294967295 which will NOT fit in a 4-byte ZD field, so LENGTH=10 would make more sense unless your maximum BI value happens to be only 9999.
Back to top
View user's profile Send private message
janani vs

New User


Joined: 01 Sep 2009
Posts: 15
Location: CHENNAI

PostPosted: Thu Oct 01, 2009 12:34 pm    Post subject:
Reply with quote

Thanks a lot. I got it sorted out.
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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