View previous topic :: View next topic
|
Author |
Message |
nobin
New User
Joined: 21 Nov 2007 Posts: 9 Location: India
|
|
|
|
Hi,
Can we convert a 9(3) field to 9(4) field using DFSORT?.
The input file is of 120 byte (record layout is of 100 bytes data and 20 byte filler). The field i need to convert is at starting offset 48. Can we handle the length increase of a field in between using DFSORT?
Thanks in advance,
Thanks,
Nobin |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
nobin,
Yes, that is possible. But to do that u need to give more details.
1) What should be the output record length? Shd it be +1 of that of input file?
If yes, Use OUTREC/INREC BUILD for your requirement. |
|
Back to top |
|
|
nobin
New User
Joined: 21 Nov 2007 Posts: 9 Location: India
|
|
|
|
Hi Aaru,
Actually I need to update the input file. Since there is enough filler available, I need to keep the file length same and do the required offset adjustments. For eg:
Currently,
Field A occupies 1 to 47 offset,
Field B occupies 3 bytes starting from 48 position (this of 9(3))
Field C occupies 51 to 100 offsets and filler occupying remaining 20 bytes.
I need to update the file as below,
Field A --> 1 to 47 offset
Field B occupies 4 bytes starting from 48 position (this field needs to be converted from 9(3) to 9(4)).
Field C --> 52 to 101 offsets and remaining 19 bytes filler.
Thanks,
Nobin |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
use this untested SORT card
Code: |
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,47,48:48,3,ZD,EDIT=(TTTT),
51,50,120:X)
/* |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Nobin,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/120)
//SORTOUT DD DSN=... output file (FB/120)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1:1,47,
48:48,3,ZD,TO=ZD,LENGTH=4,
52:51,69)
/*
|
TO=ZD will use an F sign for the positive 4-byte ZD values. If you want a C sign instead, use TO=ZDC instead of TO=ZD.
Krisprems,
Code: |
48,3,ZD,EDIT=(TTTT)
|
will work for positive values only which might be what's needed as implied by the format of 9(4), but TO=ZD,LENGTH=4 is probably a better choice since it will handle positive and negative values. TO=ZDC is obviously the best choice if C signs are needed. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
sorry Frank, i couldnt test it.I was away from mainframe |
|
Back to top |
|
|
|