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
 

 

Can we move a 01 level record another level record

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

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Tue Jun 12, 2012 12:59 am    Post subject: Can we move a 01 level record another level record
Reply with quote

Hi Experts,

Can we move a 01 level record another level record.
Something like the below one ..


I have one record structure like this:

Code:
01  ROOT-RECORD.                                               
 02  X-RECORD-KEY.                                               
    05  X-MAS.                                                   
        10  X-PFXA                        PIC X(4).       
        10  X-PFXB                        PIC X(4).       
  .....
  .....
  .....
 
 
02  X-NEXT-RECORD.                                     
   05  X-NEXT-SECTION.                             
       10  X-KEY                            PIC X(36)
   05  X-THE-SECTION.                             
       10  X-THE-NUMBER.                               
           15  X-PFXA                       PIC X(4).
  .....
  .....
  .....
  .....
 
 
02  X-MAIN-RECORD.                                 
 03  X-MAIN-DATA.                                       
   05  X-MAIN-INFO.                                       
       10  FILLER                             PIC X(18). 
       10  X-MAIN-DATE                 COMP-3 PIC 9(7).   
       10  FILLER                             PIC X(14). 



******

This is the second record structure.

Code:
01  T-MAIN-RECORD.                                     
  03  T-MAIN-DATA.                                       
    05  T-MAIN-INFO.                                         
        10  FILLER                         PIC X(18).   
        10  T-MAIN-DATE                COMP-3 PIC 9(7).   
        10  FILLER                            PIC X(14).




Now, In my program , Can I use something like:

Code:
MOVE    T-MAIN-RECORD      TO      X-MAIN-RECORD





Thanks in advance.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jun 12, 2012 1:04 am    Post subject: Reply to: Question on MOVE!
Reply with quote

Yep. No problem at all.

If the subordinate items match up you can always do it with no problem.

If the subordinate items don't match, you can still do the MOVE, but you'll get problems with the data.

Your items all match up, so MOVE away.
Back to top
View user's profile Send private message
fredrick andrews

New User


Joined: 10 Jun 2010
Posts: 52
Location: chennai

PostPosted: Tue Jun 12, 2012 1:35 am    Post subject:
Reply with quote

Thanks a ton Bill...
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jun 12, 2012 12:33 pm    Post subject:
Reply with quote

PS.: Bill is knowledgable and saved you time but why not just experiment for such things.

Suggest you also search on MOVE CORRESPONDING and spend some time with it.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jun 12, 2012 1:05 pm    Post subject: Reply to: Question on MOVE!
Reply with quote

Ah. I have an aversion to MOVE CORRESPONDING :-)

In this case, it looks like one item has been defined to be used in the program but not necessarily not wanting the other data called FILLER, which the CORRESPONDING would ignore. I think it is needed (the stuff in the FILLER) otherwise it would simply be a case of MOVEing the item itself, no need to wonder about the group MOVE.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jun 12, 2012 1:27 pm    Post subject: Re: Reply to: Question on MOVE!
Reply with quote

Bill Woodger wrote:
Ah. I have an aversion to MOVE CORRESPONDING :-)
Why should you and me only deal with the pain, why not share it with OP as well... icon_biggrin.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Tue Jun 12, 2012 8:22 pm    Post subject: Reply to: Question on MOVE!
Reply with quote

Not sure yet if it is important, but...
when you say:
fredrick andrews wrote:
Can we move a 01 level record another level record.
Something like the below one ..
I have one record structure like this:
Do you mean these variables are declared in the FILE SECTION, or are they in the WORKING-STORAGE SECTION ?
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
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
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


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