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
 
Move numeric field to alpha numeric field.

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

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Wed Sep 09, 2009 3:57 pm    Post subject: Move numeric field to alpha numeric field.
Reply with quote

Hi all,
I have date in a variable with PIC s9(9) comp.
I want the value to be moved into the output field with lenght PIC x(8). Can anyone please tell me how can I move this?

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

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Sep 09, 2009 4:03 pm    Post subject:
Reply with quote

What you have tried on this??
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Wed Sep 09, 2009 4:08 pm    Post subject:
Reply with quote

I have tried:

I have DOCUMENT-DATE PIC X(08).
and W040-EQRFND-TRANSDTE pic s9(9) comp.



01 W10-TRANSDT-DATE.
03 W10-MACHDTE.
05 W10-MACHDTE-CC PIC XX.
05 W10-MACHDTE-YY PIC XX.
05 W10-MACHDTE-MM PIC XX.
05 W10-MACHDTE-DD PIC XX.

01 WS-MACH-DTE-TMP PIC 9(8) VALUE ZERO.
01 WS-MACH-DTE-COMP PIC S9(9) COMP.


MOVE W040-EQRFND-TRANSDTE (W040-EQRFND-SUB)
TO WS-MACH-DTE-COMP
MOVE WS-MACH-DTE-COMP TO WS-MACH-DTE-TMP
MOVE WS-MACH-DTE-TMP(1:2) TO W10-MACHDTE-CC
MOVE WS-MACH-DTE-TMP(3:2) TO W10-MACHDTE-YY
MOVE WS-MACH-DTE-TMP(5:2) TO W10-MACHDTE-MM
MOVE WS-MACH-DTE-TMP(7:2) TO W10-MACHDTE-DD


MOVE W10-MACHDTE TO DOCUMENT-DATE OF WEBIN02
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 09, 2009 4:15 pm    Post subject:
Reply with quote

Why not
Code:
05  DOCUMENT-DATE-N PIC 9(08).
05  DOCUMENT-DATE REDEFINES DOCUMENT-DATE-N
                  PIC X(08).



MOVE W040-EQRFND-TRANSDTE TO DOCUMENT-DATE-N.
You move the USAGE COMP field to a USAGE DISPLAY field that is numeric, redefine it, and use the alphanumeric field as you wish.
Back to top
View user's profile Send private message
smilingashutosh

New User


Joined: 08 Jun 2006
Posts: 22

PostPosted: Wed Sep 09, 2009 4:26 pm    Post subject:
Reply with quote

TRY THIS...lemme know in case of error

I have DOCUMENT-DATE PIC X(08).
and W040-EQRFND-TRANSDTE pic s9(9) comp.



01 W10-TRANSDT-DATE.
03 W10-MACHDTE.
05 W10-MACHDTE-CC PIC XX.
05 W10-MACHDTE-YY PIC XX.
05 W10-MACHDTE-MM PIC XX.
05 W10-MACHDTE-DD PIC XX.

01 WS-MACH-DTE-TMP PIC 9(8) VALUE ZERO.
01 WS-MACH-DTE PIC 9(9).


MOVE W040-EQRFND-TRANSDTE (W040-EQRFND-SUB)
TO WS-MACH-DTE
MOVE WS-MACH-DTE(2:2) TO W10-MACHDTE-CC
MOVE WS-MACH-DTE(4:2) TO W10-MACHDTE-YY
MOVE WS-MACH-DTE(6:2) TO W10-MACHDTE-MM
MOVE WS-MACH-DTE(8:2) TO W10-MACHDTE-DD


MOVE W10-MACHDTE TO DOCUMENT-DATE OF WEBIN02
Back to top
View user's profile Send private message
saji123

New User


Joined: 15 Jul 2009
Posts: 19
Location: Chennai

PostPosted: Thu Sep 10, 2009 11:35 am    Post subject:
Reply with quote

Thank you all
It is working fine now..
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
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. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

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