Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7314

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: 7314

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: 1252
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
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us