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
 

 

How to access a variable length record from varible block fi

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: How to access a variable length record from varible block fi
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: 755
Location: Germany

PostPosted: Mon Sep 18, 2006 5:17 pm    Post subject:
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    Post subject:
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: 755
Location: Germany

PostPosted: Tue Sep 26, 2006 2:04 pm    Post subject: Re: How to access a variable length record from varible bloc
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: 755
Location: Germany

PostPosted: Tue Sep 26, 2006 2:11 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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