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
 

 

Move statement query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Sun Nov 21, 2010 1:57 am    Post subject: Move statement query
Reply with quote

Hi,

I have a copy book ABCRL having the following layout.

Code:
01 ABC-RECORD.
    03 ABC-KEY.
        05 ABC-NAME  PIC X(20).
        05 ABC-NO    PIC 9(10).
    03 ABC-VARIABLE-AREA.
        05 ABC-ADD-AREA PIC X(4000).

I have another copy book RSTRL having the following layout.

Code:
01 RST-RECORD.
    02 RST-KEY1.
        03 RST-MFR     PIC X(25).
    02 RST-RECORD.
        03 RST-KEY.
            05 RST-NAME  PIC X(20).
            05 RST-NO    PIC 9(10).
        03 RST-VARIABLE-AREA.
            05 RST-ADD-DATA PIC X(4000).


My Query is can i move the 01 level of ABCRL to 02 level of RSTRL i.e.
Code:
MOVE ABC-RECORD     TO RST-RECORD.


I think from lower level (03) to higher level (01) group move is fine, but i am not sure about the above higher level 01 group move to 02 group level .

Please help me , if the move is not allowed then please let me know how it can be achieved.

Thanks,
Nagaraja
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: Sun Nov 21, 2010 2:56 am    Post subject:
Reply with quote

Hello,

There is no problem either way.

An alphanumeric move (group levels are alphanumeric) moves some number of bytes from one address to another. If the 2 are not of equal length, truncation or padding may occur but if they are the same it is just a straight move.
Back to top
View user's profile Send private message
pnkumar
Warnings : 2

New User


Joined: 27 Oct 2005
Posts: 24

PostPosted: Sun Nov 21, 2010 3:30 am    Post subject:
Reply with quote

Thanks Dick Scherrer, for your quick response.

My confusion is with the levels, as per your answer i understood that there is no problem with the levels, the movement should be a straight one and if both are having the same length then no truncation will occur otherwise truncation will occur.

Please clarify if i am wrong.

Thanks,
Nagaraja
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: Sun Nov 21, 2010 6:07 am    Post subject: Reply to: Move statement query
Reply with quote

Quote:
i understood that there is no problem with the levels, the movement should be a straight one and if both are having the same length then no truncation will occur otherwise truncation will occur.


You are correct icon_smile.gif

At the top of the page is a link to "IBM Manuals". Suggest you read about MOVE in the Language Reference for your release of COBOL.

d
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm


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