View previous topic :: View next topic
|
Author |
Message |
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
I am working on one migration where we are writing a record on GSAM variable blocked file.
Output layout has below layout -
Code: |
01 DATA.
05 DATA-LENGTH PIC S9(4) COMP.
05 DATA-RECORD PIC X(5000).
|
We are using DATA variable mentioned above while writing into GSAM after moving some length like +104 into DATA-LENGTH and some text value onto DATA-RECORD.
On output file, we can see first 2 bytes of data is getting truncated.
e.g.
Code: |
HELLOW WORLD is seen as LLOW WORLD |
.
Any idea on what special arrangement is required while working GSAM variable blocked files ? I remember first 4 bytes are getting allocated to length in variable blocked file.
No issues are observed in fixed blocked GSAM. All is well there.. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Are you including the length of DATA-LENGTH itself in the data length? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
The (R)ecord (D)escriptor (W)ord of a VB data set is 4 bytes long. S9(4) COMP is only 2 bytes. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The RDW is 4 bytes, but the record length is the first 2 bytes of it -- the second two bytes are reserved (and used with VBS records). You need to add a 2-byte filler after your record length variable. |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Seems right, i was trying to increase S9(4) COMP to S9(8) COMP.
But it was still failing.
Let me add 2 bytes of FILLER after S9(4) COMP length variable.
Will keep you posted.
Thanks for your response. |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
We updated code as per above thought but its new problem.
Its causing last 2bytes getting truncated.
Do I need to increase length of record by 2 byes as we added FILLER of 2 bytes after length ? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Are you doing the write from a COBOL program? You don't need the RDW, in fact you can't have the RDW.
There are several techniques to write variable-length records. If for yours you are just writing data of a particular length, structure unimportant to your program, then probably RECORD IS VARYING DEPENDING ON will be the most suitable. |
|
Back to top |
|
|
|