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: 8195
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: 1250
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: 1931
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 Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

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