MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

populating SMALLINT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
new user
Beginner


Joined: 12 Oct 2004
Posts: 7
Topics: 3

PostPosted: Fri Oct 15, 2004 12:28 pm    Post subject: populating SMALLINT Reply with quote

Hi

i have a sequential file of 80 bytes (FB). i am adding a identifier field of length 1 (which takes value 1,2) at position 81 using DFSORT and finally loading the values to a DB2 table.

The hardcoded identifier field should populate a column of type SMALLINT in the table.As SMALLINT is equivalent to PIC S9(4) COMP, the hardcoded value needs to be the binary equivalent of the identifier.

In that case, the OUTREC card should look something like

OUTREC = (1:1,80,81: B'10')

but it is not giving me the desired result in the table.

Thanks
-new user
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Oct 15, 2004 1:29 pm    Post subject: Reply with quote

Try this

S9(04) comp is 2 bytes in length. so if you want to move 1 in that field, the following sort card gives you the desired result.

Code:

OUTREC FIELDS=(1:1,80,81:X'0001')


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Oct 15, 2004 2:22 pm    Post subject: Reply with quote

Here's another way to do it with DFSORT:

Code:

  OPTION COPY
  OUTREC FIELDS=(1,80,81:+1,TO=BI,LENGTH=2) 

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
new user
Beginner


Joined: 12 Oct 2004
Posts: 7
Topics: 3

PostPosted: Mon Oct 18, 2004 9:49 am    Post subject: Reply with quote

Thanks a lot Frank and Kolusu.

it really helped

Regards
-new user
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group