Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 757
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: 757
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: 757
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us