IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Edit mask in Move Edited.


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahulvv

New User


Joined: 05 Apr 2006
Posts: 3
Location: Mumbai, India

PostPosted: Mon Oct 12, 2009 11:56 am
Reply with quote

Hi,

Could someone help me with the difference in the statements 1 and 2:
1. MOVE EDITED operand1 TO operand2 (EM=value)
2. MOVE EDITED operand1 (EM=value) TO operand2

Please avoid giving the programming guide definition as I have gone thru them.

My usual code would look like:

Code:

DEFINE DATA                             
LOCAL                                   
01 #DAT (A8)                             
01 #DATE (D)                             
END-DEFINE                               
*                                       
#DAT := '10122009'                       
MOVE EDITED #DAT   TO #DATE (EM=MMDDYYYY)
WRITE #DATE                             
END                                     


And this would work fine.
But if I code
Code:
 MOVE EDITED #DAT (EM=MMDDYYYY)  TO #DATE


this would not even stow.

Could anybody please explain to me the reason?
How exactly does the EM work?

Thanks,

Rahul
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Oct 12, 2009 5:24 pm
Reply with quote

Sorry, I really tried to phrase my own answer, but then I looked at the manual (Statements --> MOVE) and noticed that Software-AG phrased it in a better way.

O.
Back to top
View user's profile Send private message
atulbagewadikar

New User


Joined: 15 Jun 2006
Posts: 26

PostPosted: Wed Oct 14, 2009 1:05 pm
Reply with quote

Hi Rahul,

Why don't you try this way? See the changes and try to find how it works now?

I believe you will find out your answer after this.

Code:
DEFINE DATA LOCAL                                                       
1 #DAT (N8)                                                             
1 REDEFINE #DAT                                                         
  2 #DAT-A (A8)                                                         
1 #DAT-A-10 (A10)                                                       
1 #DATE (D)                                                             
END-DEFINE                                                               
#DAT := 20090729                                                         
*                                                                       
MOVE EDITED #DAT-A TO #DATE (EM=YYYYMMDD)                               
*                                                                       
MOVE EDITED #DATE (EM=YYYY/MM/DD) TO #DAT-A-10                           
*                                                                       
WRITE '=' #DAT-A-10 '=' #DATE                                           
END           


Output

Code:
MORE                                                                           
Page     1                                                   09-10-14  18:32:33
                                                                               
#DAT-A-10: 2009/07/29 #DATE: 09-07-29                   
Back to top
View user's profile Send private message
Steve Robinson

New User


Joined: 14 Nov 2009
Posts: 12
Location: U.S.

PostPosted: Sat Nov 14, 2009 11:42 pm
Reply with quote

Could someone help me with the difference in the statements 1 and 2:
1. MOVE EDITED operand1 TO operand2 (EM=value)
2. MOVE EDITED operand1 (EM=value) TO operand2


Statement 2 takes operand1 and applies the specified edit mask to create operand2.

Statement 1 is actually a "de edit" operation. It takes operand1 and removes the editing characters specified in the edit mask to create operand2. Careful. If the editing characters do not exist in operand1 you will get an error message.

steve
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
Search our Forums:

Back to Top