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 

to copy comp-3 value to output file and store as numeric

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
manojy2k
Beginner


Joined: 19 Jan 2003
Posts: 6
Topics: 3
Location: India

PostPosted: Thu Feb 06, 2003 3:11 am    Post subject: to copy comp-3 value to output file and store as numeric Reply with quote

Hi,

I have a input file at 10th position variable x is defined at pic s9(3) comp-3. As the value will be stored in 2 bytes, my requirement is to copy this value to a output file at position 4 and store this value as numeric 3 bytes and in the output file the variable is defined as pic s9(3).

I am using syncsort and here is what I am giving

INREC Fields=(4:10,2,pd,zd)

But I am not getting proper value in the output file. As I assumed from the above syntax

From the inputfile at 10th position take the 2byte value which is comp-3 and put it in the output file at 4th position as zonal decimal.

But why I am not getting proper value ?

Anything I am missing here ?

Looking forward for a effective solution ?

Thanks,
Manoj.
manojy2k@yahoo.com
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Premkumar
Moderator


Joined: 28 Nov 2002
Posts: 77
Topics: 7
Location: Chennai, India

PostPosted: Thu Feb 06, 2003 3:26 am    Post subject: Reply with quote

Manoj,

Could you post your input and output data?
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Feb 06, 2003 7:21 am    Post subject: Reply with quote

Manoj,

Try this

Code:

INREC FIELDS=(4:10,2,PD,EDIT=(STTT),SIGNS=('+','-',,))


Hope this helps...

cheers

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: Thu Feb 06, 2003 11:45 am    Post subject: Reply with quote

Ravi,
With DFSORT, your INREC statement will give you what you want because for PD to ZD conversion, DFSORT uses a F sign for the last digit which makes it printable (e.g. X'123C' -> X'F1F2F3' -> C'123'). But I believe Syncsort uses a C sign for the last digit which makes it unprintable (e.g. X'123C' -> X'F1F2C3' -> -> C'12C'). Is that what you're seeing?

Assuming your PD values are all positive, this will give you the equivalent of printable positive ZD values:

Code:

   INREC FIELDS=(4:10,2,PD,M11) 


M11 is a mask for T...T where T is a digit with leading zeros printed.

If you do have negative numbers, then you can't get printable ZD values because the sign for ZD is D (e.g. X'123D' -> X'F1F2D3' -> C'12L'), so you'd have to figure out what you really want the output to look like. Kolusu's example with EDIT=(STTT) and SIGNS is one possibility. For DFSORT, the M26 edit mask will give you the same thing, but I don't think Syncsort supports M26.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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