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 

Move

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


Joined: 18 Oct 2004
Posts: 5
Topics: 5

PostPosted: Tue Oct 19, 2004 12:42 am    Post subject: Move Reply with quote

How to move
REQUESTED-DATE-CC PIC XX.
REQUESTED-DATE-YY PIC XX.
these 2 variable into,
MTC-COMM-PROC-MTH-NR PIC S9(04) COMP
this variable?

ex: CC - 19
YY - 99

and populate
MTH-NR as 1999?
Back to top
View user's profile Send private message
cobcurious
Beginner


Joined: 04 Oct 2003
Posts: 68
Topics: 25

PostPosted: Tue Oct 19, 2004 4:51 am    Post subject: Reply with quote

Hi vj2081,
I believe you can make a group levelfield for the REQUESTED-DATE-CC PIC XX and REQUESTED-DATE-YY PIC XX.Say
01 Group
05 REQUESTED-DATE-CC PIC XX.
05 REQUESTED-DATE-YY PIC XX.
01 MTC-COMM-PROC-MTH-NR PIC S9(04) COMP .

Move Group to MTC-COMM-PROC-MTH-NR.

This will serve your purpose...but ensure you have numeric field going in GROUP variable
Thanks
Cobcurious
8)
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Wed Oct 20, 2004 11:32 am    Post subject: Reply with quote

S9(04) COMP is half-word binary i.e. two bytes. Your source data is a total of four bytes. Are you sure, you want to do this?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Thu Nov 18, 2004 2:05 pm    Post subject: Reply with quote

I know my fundamentals arent very strong but can somebody explain why a 4 byte numeric field cant be stored in a 9(04) comp field.

I ask this because if you consider a packed decimal field,
a 5 byte field say yyddd can be stored occupying 3 bytes in a 9(5) comp-3 field.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Nov 19, 2004 2:01 am    Post subject: Reply with quote

mfjin,

A S9(1) through S9(4) COMP (Binary half-word (2 bytes)) can be used to store values ranging from -32768 through +32767

I don't see any problem in storing a 4 byte numeric into 2 byte comp field.

Check this link which explains the storage ranges of all COMP variables.

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
mfjin
Beginner


Joined: 26 Apr 2003
Posts: 94
Topics: 17

PostPosted: Fri Nov 19, 2004 2:28 am    Post subject: Reply with quote

Thanks Kolusu for affirming what I said. cogitos and ravis posts made me think otherwise.

Also, youve missed the link. Can you pls post it so that i can see what it says?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Nov 19, 2004 6:50 am    Post subject: Reply with quote

mfjin,

oops here is the link .

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/5.3.16.1?SHELF=&DT=20020920180651&CASE=

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Fri Nov 19, 2004 8:57 am    Post subject: Reply with quote

Quote:
REQUESTED-DATE-CC PIC XX.
REQUESTED-DATE-YY PIC XX.
these 2 variable into,
MTC-COMM-PROC-MTH-NR PIC S9(04) COMP


Unless I'm missing something, all you need is:
Code:

01  REQ-DATE-CCYY.
      03  REQUESTED-DATE-CC PIC XX.
      03  REQUESTED-DATE-YY PIC XX.
01  REQ-DATE-CCYY-NUM REDEFINES REQ-DATE-CCYY PIC 9(4).
.
.
.
MOVE REQ-DATE-CCYY-NUM TO MTC-COMM-PROC-MTH-NR.
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 -> Application Programming 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