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

Converting 9(3) field to 9(4) field


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

New User


Joined: 21 Nov 2007
Posts: 9
Location: India

PostPosted: Wed Nov 21, 2007 4:30 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Nov 21, 2007 4:38 pm
Reply with quote

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
View user's profile Send private message
nobin

New User


Joined: 21 Nov 2007
Posts: 9
Location: India

PostPosted: Wed Nov 21, 2007 5:06 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Nov 21, 2007 5:45 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 21, 2007 11:16 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Nov 21, 2007 11:22 pm
Reply with quote

sorry Frank, i couldnt test it.I was away from mainframe
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 Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts S0C7 - Field getting overlayed COBOL Programming 2
No new posts Converting fixed length file to excel... IBM Tools 7
Search our Forums:

Back to Top