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

Changing Format of a Field


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

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Apr 02, 2008 10:45 am
Reply with quote

I have a field in my input file with PIC 9(03) but DB2 table structure has SMALLINT for the same field. So, I want to change 9(03) value into
S9(04) COMP.

Can we do this through DFSORT? Please let me know if this can be possible in any other way.

Record Length: 100, Format: FB, field position is 29-31 and this should be chnaged to 29-30.

My input data looks like below.

2----+----3----+--
************** Top
0..r%....004VAIB02

Here my value for TIER_NBR is '004', is starting at 29 and ending at 31 but DB2 load card looks like below.

TIER_NBR POSITION( 29 )
SMALLINT,
PRGRAM_UPDATE POSITION( 31 )
CHAR( 08) ,

Here TIER_NBR is starting at 29 and ending at 30 and Program update is starting at 31 (in my example VAIB....). But in my input file Program Update is starting at 32. I want to restrict TIER_NBR into 2 digits only.

Regards,
KSK
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 02, 2008 7:11 pm
Reply with quote

Hello,

Quote:
I want to restrict TIER_NBR into 2 digits only
Is this correct or should the size be 2 bytes rather than 2 digits?
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 Apr 02, 2008 9:18 pm
Reply with quote

KSK,

You can use DFSORT control statements like the following to do what you asked for. I didn't know what you wanted after the PROGRAM_UPDATE field (if anything) so I showed that as ...

Code:

  OPTION COPY
  INREC BUILD=(1,28,29,3,ZD,TO=BI,LENGTH=2,31:32,8,...)
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Thu Apr 03, 2008 11:31 am
Reply with quote

Dick,

yes, you are right, it should be 2 bytes not 2 digits.

Frank,

Thanks for your solution, it is working.

Regards,
KSK
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 Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top