Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us