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
 
writing a COMP variable in File

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

New User


Joined: 04 May 2007
Posts: 21
Location: kuala lumpur

PostPosted: Tue May 01, 2012 4:55 pm    Post subject: writing a COMP variable in File
Reply with quote

Hi,

I have a copybook of an output file(107 bytes) as

01 OUT-LOAD-REC.
05 FILLER PIC X(07) VALUE 'EVENTID'.
05 FILLER PIC X VALUE SPACES.
05 PROD-EVNT-ID PIC S9(09) COMP VALUE +0.
05 FILLER PIC X VALUE SPACES.
05 PROD-ID PIC S9(04) COMP VALUE +0.
05 FILLER PIC X VALUE SPACES.
05 PROD-TIMESTAMP PIC X(26).
05 FILLER PIC X(65).


i am moving data into prod-evnt-id and prod-id as

MOVE WS-PROD-EVENT-ID TO PROD-EVNT-ID OF OUT-LOAD-REC.
MOVE WS-PROD-CD-JCL-PARM TO PROD-ID OF OUT-LOAD-REC.

the variables i declared are
WS-PROD-EVENT-ID PIC S9(9) USAGE COMP
WS-PROD-CD-JCL-PARM PIC S9(04) COMP VALUE +0


now when i am writing the file the output comes like...
EVENTID 2012-05-01-06.13.51.959334

I am not getting where i am missing the thing.

Please help.

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

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Tue May 01, 2012 5:15 pm    Post subject:
Reply with quote

Since you did not use the CODE tag in your post, it is not possible for us to say what is going on. If you repost your data with a CODE tag, which preserves characters exactly as they are, that would help. It would also help if you displayed the data in hexadecimal format rather than character -- use HEX ON in TSO/ISPF to turn on the hex display.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 01, 2012 9:38 pm    Post subject:
Reply with quote

Hello,

Your one line output appears as i would expect. . . The "spaces" between EVENTID and 2012 are almost surely unprintable characters (x'00' shows as a space). It looks like your code is working properly from what you have posted.

As Robert mentioned, you need to use the code tag to preserve alignment and improve readability. I suspect that after being here 5 years (happy anniversary!) you have seen the code tags used. . .

We also have a preview function so you can see your post as it will appear to the forum (rather than how it appears in the Reply Editor). When you have what you want, Submit.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed May 02, 2012 1:44 am    Post subject:
Reply with quote

in edit, use FIND P'.'
What looks like a space will show its actual value in the message area.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1869
Location: UK

PostPosted: Wed May 02, 2012 2:37 pm    Post subject:
Reply with quote

After 5 years you should know how to look at your data in ISPF using HEX.
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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