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

How to access a variable length record from varible block fi


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

New User


Joined: 18 Mar 2005
Posts: 48
Location: india

PostPosted: Mon Sep 18, 2006 4:55 pm
Reply with quote

Hello Guys,

How to access a variable length record from varible block file? What are the changes that I need to do on the DCB parameter to access a variable length file..

Also, how to define the assembler variable for varible length record.

Please let me know with a sample code & explaination.

Thanks in advance.

Regards,
Gokuldass
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Sep 18, 2006 5:17 pm
Reply with quote

Hi !

Specify RECFM=VB in the DCB.
The normal GET will provide you the records you read.
When you want to write such records you have to provide the length field.

Definition of an area, in wich you read the record is done in normal way.
Must be max-size, the records can have.


Regards, UmeySan
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Tue Sep 26, 2006 6:08 am
Reply with quote

Don't forget to clear your data area before loading your input record to ensure that you don't get residual data from a previous longer record.

Code:

   MVI   DATA,C' '
   MVC   DATA+1(length),DATA
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Sep 26, 2006 2:04 pm
Reply with quote

Hi TizMe !

That's correct. But what's about the VarLength? And what is, if Lrecl is grater 255Bytes?

According to your example, you also can do this by an XC instruction.
XC record,record ...set all bytes of record to hex-zero

I think, best way for variable cleaning is to use a MVCL instruction.

S3L00 DS 0H Delete the InOutSentence

L R4,AS3SATZ ...Adress of Sentence
L R5,=A(30000) ...Max Length
*
LA R2,S3LHNULL ...Init Field Hex Zero
SR R3,R3 ...Clean Register 3
ICM R3,8,=X'00' ...DeleteCharacter is Hex Zero
*
MVCL R4,R2 ...Clear the whole Sentence 30.000 Bytes


In stead of "L R5,=A(30000)" you could load the actual length of the actual record into register 5. Use the LengthBytes of the record.

Regards, UmeySan
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Sep 26, 2006 2:11 pm
Reply with quote

Hi TizMe !

I forgot something, sorry.

In your example, you have to take care of the fields defined after DATA.
MVI DATA,C' '
MVC DATA+1(length),DATA

Here length has to be "LengthOfData - 1Byte"
MVC DATA+1(L'DATA-1),DATA

You also can define one Byte before the field called DATA for only use of cleaning an then using this field in your command. No use of length.
DC CL01' '
DATA DC CL80' '

MVC DATA,DATA-1

Regards, UmeySan
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top