IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

writing a COMP variable in File


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue May 01, 2012 5:15 pm
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

Moderator Emeritus


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

PostPosted: Tue May 01, 2012 9:38 pm
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: 1353
Location: Israel

PostPosted: Wed May 02, 2012 1:44 am
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: 2455
Location: Hampshire, UK

PostPosted: Wed May 02, 2012 2:37 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top