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
 
Comp3 to Alphanumeric

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

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Tue Feb 10, 2009 12:10 pm    Post subject: Comp3 to Alphanumeric
Reply with quote

How to Move a S9(9) comp3 variable to X(6) variable

THis is need to retrieve the date in 'CCYYMMDD' format to MMDDYY format.
s9(9) comp 3 is of CCYYMMDD format and
X(6) should be in MMDDYY format
Back to top
View user's profile Send private message

Girish Firke

New User


Joined: 04 Feb 2009
Posts: 5
Location: Mumbai

PostPosted: Tue Feb 10, 2009 12:49 pm    Post subject: Reply to: Comp3 to Alphanumeric
Reply with quote

Hi Raki,

First move S9(9) comp-3 into 9(9) field-B.
Then you can move last 6 bytes of field-B to another field-C.
please see below example.

Working-storage section.
01 WS-A PIC S9(9) comp-3.
01 WS-B PIC 9(9).
01 WS-C PIC X(6).

PROCEDURE DIVISION.
MOVE WS-A TO WS-B.
MOVE WS-B(6:4) TO WS-C(1:4).
MOVE WS-B(4:2) TO WS-C(5:2).
GOBACK.




Thanks,
Girish icon_biggrin.gif
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 Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
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
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm

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