|
View previous topic :: View next topic
|
| Author |
Message |
kumarmca1
New User
Joined: 06 Jul 2009 Posts: 13 Location: chennai
|
|
|
|
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 |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8798 Location: Welsh Wales
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| 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 |
|
 |
kumarmca1
New User
Joined: 06 Jul 2009 Posts: 13 Location: chennai
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|