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
 

 

Blank in VB file after the length of the record

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

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Fri Nov 16, 2007 10:41 pm    Post subject: Blank in VB file after the length of the record
Reply with quote

Hello,

I am trying to write data to a VB file. The record length is known to me.

My problem is I get X'40' after the length of the record. I need to get X' ' after the length of the record.
I am initializing the varaible with Initialize keyword and am using string to move the data into the last variable.

Still I keep getting the X'40' after the record length.

The file is of length 1000 and the record length is 452. Hence I should not be seeing X'40' after 453 position.

I have only two variables for any record to be written out to the VB file.

01 RECORD-ID PIC 9(4)
01 RECORD-DATA PIC X(996)

Could any one suggest what am I missing to achive the result.

Thanks.

Sudhir
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Nov 16, 2007 11:33 pm    Post subject: Re: Blank in VB file
Reply with quote

sudhirk63 wrote:
Hello,

I am trying to write data to a VB file. The record length is known to me.

My problem is I get X'40' after the length of the record. I need to get X' ' after the length of the record.
I am initializing the varaible with Initialize keyword and am using string to move the data into the last variable.

Still I keep getting the X'40' after the record length.

The file is of length 1000 and the record length is 452. Hence I should not be seeing X'40' after 453 position.

I have only two variables for any record to be written out to the VB file.

01 RECORD-ID PIC 9(4)
01 RECORD-DATA PIC X(996)

Could any one suggest what am I missing to achive the result.

Thanks.

Sudhir

X'40' is what intialize would put in the record. Try
MOVE ALL 'X' TO RECORD-DATA.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Nov 16, 2007 11:37 pm    Post subject:
Reply with quote

Why are you filling the record with anything, just set the record length to 452, that is reason for VB files.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 16, 2007 11:46 pm    Post subject:
Reply with quote

Are you looking at the record in EDIT mode from TSO/ISPF ???

Because if you are, that is the problem.
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Sat Nov 17, 2007 12:17 am    Post subject:
Reply with quote

Even when i am in browse mode I can see trailing spaces. In the input file when I put hex on , value is X' '.

I am not sure I got this :

MOVE ALL 'X' TO RECORD-DATA.

This will put the literal 'X' in all the places.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat Nov 17, 2007 12:56 am    Post subject:
Reply with quote

sudhirk63 wrote:
Even when i am in browse mode I can see trailing spaces. In the input file when I put hex on , value is X' '.

I am not sure I got this :

MOVE ALL 'X' TO RECORD-DATA.

This will put the literal 'X' in all the places.


There is not such thing as x'' or x' '! The hex representation of any single byte value consists of of TWO character from the set of '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'.
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Sat Nov 17, 2007 12:56 am    Post subject:
Reply with quote

Sorry guys, I found the mistake in my code.

100 lashes to me.
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: Sat Nov 17, 2007 10:13 am    Post subject: Reply to: Blank in VB file after the length of the record
Reply with quote

Well, you've whipped yourself, so we shouldn't icon_smile.gif

Thank you for posting that you've found/fixed the problem. If you mention what the fix was, it may help someone else later.

d
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