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
 

 

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: 8117
Location: East Dubuque, Illinois, 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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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