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
 

 

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
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
No new posts alphanumeric sequence generation sivaprasad.gadhi COBOL Programming 6 Wed Mar 30, 2016 3:03 am
No new posts alphanumeric sequence generation sivaprasad.gadhi DFSORT/ICETOOL 8 Mon Mar 21, 2016 1:09 am
No new posts To determine the range on a Alphanume... Prasanth Kumar COBOL Programming 3 Mon Feb 15, 2016 9:35 am


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