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

Plz help in outrec in dfsort !!! I got return code 16


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

New User


Joined: 06 Jul 2009
Posts: 13
Location: chennai

PostPosted: Thu Dec 17, 2009 8:19 pm
Reply with quote

Hi all,

My requirement is to increase two fields in output field

Code:
ie

Record Type
 
From     To  Length   Field
1          4      4         Record type
5          8      4         Department cod
9         12      4         Commodiyt /* Which should be increased to length  25 ie adding another 21 blank/*
13        72     60         Product description /*
                            Which should be increased to length 100 ie adding another 40 blank */



I have written an outrec with below syntax

Code:
SORT FIELDS=COPY                             
OUTREC FIELDS=(1:1,12,13:21X,34:13,72,94:40X)


While executing this i got Return Code : 16 with below error message



Code:
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 14:17 ON THU DEC
            SORT FIELDS=COPY                                                   
            OUTREC FIELDS=(1:1,12,13:21X,34:13,72,94:40X,134:73,80)             
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE126A 0 INCONSISTENT *OUTREC  IFTHEN 0 REFORMATTING FIELD FOUND               
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E9-K06751 E7-K90000           
ICE052I 3 END OF DFSORT                                                         



Thanks,
Muthu.

Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 17, 2009 8:42 pm
Reply with quote

You will need to adapt the positions to suit your needs, but this works OK for me to reformat records.
This basically puts 21 spaces after the first 14 bytes, then the 4 bytes from column 15 and then pads the record to 120 bytes with spaces.
The SORTIN DD * input is 80 bytes and the SORTOUT output is 120 bytes.
Code:
//SORTIN   DD *                                       
0001-0404-123499999       
0001-0404-123499999                                   
0001-0404-123499999                                   
0001-0404-123499999                                   
0001-0404-123499999                                   
/*                                                     
//SORTOUT  DD DSN=My.dataset.name,DISP=(,CATLG,DELETE),
//            SPACE=(TRK,(1,1),RLSE),RECFM=FB,LRECL=120
//SYSIN    DD *                                       
  OPTION COPY                                         
  OUTFIL OUTREC=(1,14,21X,15,4,120:X)

Which give s the output
Code:
0001-0404-1234                     9999           
0001-0404-1234                     9999           
0001-0404-1234                     9999           
0001-0404-1234                     9999           
0001-0404-1234                     9999           
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: Thu Dec 17, 2009 11:22 pm
Reply with quote

Code:

   OUTREC FIELDS=(1:1,12,13:21X,34:13,72,94:40X)


The reason you got an error for this is that the 34:13,72 and 94:40X fields overlap (34:13,72 ends after 94). It's not clear what you really want to do, but it would be something like this:

Code:

   OUTREC FIELDS=(1,12,34:13,72,40X)
Back to top
View user's profile Send private message
kumarmca1

New User


Joined: 06 Jul 2009
Posts: 13
Location: chennai

PostPosted: Fri Dec 18, 2009 10:45 am
Reply with quote

Hi Frank,

Thanks for the help. You are right.. I mistakenly given the input file field position rather than lenght. So i got the error.

The input file length is 80 and my output file lenght is 160

Code:
OUTREC FIELDS=(1:1,12,13:21X,34:13,60,94:40X,134:73,8)


I have used the above code and got the expected result.

Hi Expat,

Thanks for your quick reply. I got the point from your mail.

Thanks,
Muthu
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: Fri Dec 18, 2009 9:11 pm
Reply with quote

You don't need the nX fields since you have c: - I would write the OUTREC statement like this:

Code:

   OUTREC BUILD=(1:1,12,34:13,60,134:73,8)
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top