Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Changing Format of a Field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ksk

Active User


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

PostPosted: Wed Apr 02, 2008 10:45 am    Post subject: Changing Format of a Field
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

Site Director


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

PostPosted: Wed Apr 02, 2008 7:11 pm    Post subject:
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 Moderator


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

PostPosted: Wed Apr 02, 2008 9:18 pm    Post subject:
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: 356
Location: New York

PostPosted: Thu Apr 03, 2008 11:31 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us