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

Truncation in VB file


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 12:45 pm
Reply with quote

I tried to insert the YYYYMM (Current Year and Month) value in a VB record file(LERCL = 2000, RECFM=VB). A particular record size is 88. The exact value to be inserted in that record is "CP=200906'. After insertion of the above given 9 character string, what happens is the last 9 characters are truncated?

Kindly help me onto this issue.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 12:48 pm
Reply with quote

did You change also the record length to he new value ??
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 1:28 pm
Reply with quote

No, it remains 2000
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 1:34 pm
Reply with quote

review Your understanding of how variable length records work, please

the 2000 is the maximum logical record length, it is used/defined so that the program can properly allocate buffers for record processing

You should have defined in Your program an area 2000 bytes long

when You read/get the 88 bytes record, the length variable will contain 88

the record You try to build will be 88 + 9 ==> 97

You should change the record length var to 97 so that the write/put will write the correct record

/rant on
I wish that organization using VB record would give their employees proper training
all it takes is a handful of code snippets and samples
/rant off
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 1:42 pm
Reply with quote

thanks enrico,

if thats the case, then how to change the record length?

what happens is that there are so many records of different sizes and this happens to be of size 88 bytes.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 1:43 pm
Reply with quote

I just told You icon_eek.gif

for every record the variable will contain the proper length
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 1:55 pm
Reply with quote

the language of reference is PLI. they are not capturing the record length anywhere in the code.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 1:56 pm
Reply with quote

hard to believe icon_eek.gif
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 2:05 pm
Reply with quote

or maybe i dont know where its captured. do u have any sample code to show.
thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 2:12 pm
Reply with quote

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IBM3LR50/12.0?SHELF=IBMSH350&DT=20061026145308

meditate on the record definition, should be a VARYING thing

a VARYING thing is structured as a 2 bytes binary length followed by data

Your buffer should be defined accordingly
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1315
Location: Vilnius, Lithuania

PostPosted: Mon Jun 08, 2009 2:12 pm
Reply with quote

acrajesh wrote:
or maybe i dont know where its captured. do u have any sample code to show.


Excuse me, shouldn't YOU be showing YOUR code?
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 2:46 pm
Reply with quote

excuse me, we have ethics in practise. i am sure you understand.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 2:52 pm
Reply with quote

a better ethics would be to start doing a bit of work Yourself
I am sure You understand icon_cool.gif

and why not ask Your peers, You should not have any issue with them
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 2:56 pm
Reply with quote

thanks for your AWAKENING in this regard.
nice to see people like you in FORUM where we share and discuss things
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 2:57 pm
Reply with quote

follow on

I see from Your profile that Your only mainframe skill is Photography,
it would be wiser on Your side also to acquire some skill in IT related subjects
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 3:03 pm
Reply with quote

Thanks for your advice in this regard.
Its great to see such wise souls around, who answer everything apart from the question
Back to top
View user's profile Send private message
acrajesh

New User


Joined: 31 May 2007
Posts: 15
Location: Bangalore

PostPosted: Mon Jun 08, 2009 3:07 pm
Reply with quote

Thanks for not giving any concrete ideas than FREE ADVICE
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Jun 08, 2009 3:10 pm
Reply with quote

again.... did You care to look at the manual?
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top