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
 

 

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: 8117
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: 1232
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: 1823
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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