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: 1284
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 How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts TRAILER3 is creating blank record in ... kodeesm DFSORT/ICETOOL 3 Fri May 18, 2018 5:45 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts RMM Cannot move a volume from SHELF l... tspr52 IBM Tools 0 Thu Mar 01, 2018 3:48 pm
No new posts Copying only first and last word from... chandan.inst SYNCSORT 4 Wed Jan 31, 2018 4:19 pm

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