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
 

 

COBOL Move Problem

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

New User


Joined: 23 Oct 2006
Posts: 10

PostPosted: Thu Dec 07, 2006 7:06 am    Post subject: COBOL Move Problem
Reply with quote

01 CTLRMTFL-SERIALNO.
49 CTLRMTFL-SERIALNO-LEN
PIC S9(4) USAGE COMP.
49 CTLRMTFL-SERIALNO-TEXT
PIC X(15).

01 CTLRMTFL-PAGESERIAL PIC S9(12)V USAGE COMP-3.

Now we
MOVE CTLRMTFL-SERIALNO-TEXT(4:CTLRMTFL-SERIALNO-LEN - 3)
TO CTLRMTFL-PAGESERIAL.

Will we meet problem on this?
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Thu Dec 07, 2006 11:16 am    Post subject:
Reply with quote

Hi FWY

If the data contained in the variable CTLRMTFL-SERIALNO-TEXT is always of length = 15,it wont create any problem.

Thanks
Arun
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Thu Dec 07, 2006 12:03 pm    Post subject:
Reply with quote

Quote:
01 CTLRMTFL-PAGESERIAL PIC S9(12)V USAGE COMP-3.

You declared this variable as numeric
Quote:
MOVE CTLRMTFL-SERIALNO-TEXT(4:CTLRMTFL-SERIALNO-LEN - 3)
TO CTLRMTFL-PAGESERIAL.

and moving a alphanumeric variable

The compilation of the program will be sucessfull but i dont think you will get the result that you expected at the runtime
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Thu Dec 07, 2006 12:25 pm    Post subject:
Reply with quote

Hi

It will surely give the desired result presuming CTLRMTFL-SERIALNO-TEXT is having numeric data from posn 4 to 15.

Thanks
Arun
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Thu Dec 07, 2006 12:35 pm    Post subject:
Reply with quote

Yes, With that assumption it is a working one
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Thu Dec 07, 2006 12:35 pm    Post subject:
Reply with quote

Hi,
The code will work fine. It will give result without any abend.
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. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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