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
 

 

Finding length of VB/FB record size

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Mon Dec 13, 2004 6:00 pm    Post subject: Finding length of VB/FB record size
Reply with quote

Hi all,
Can anyone tell me how to find the length of each record in a variable length record or in a fixed length record in a cobol program?

Can we do it thru reference modification by checking first 4 chars of each individual record of the output dataset( of JCL) in the COBOL pgm(for VB records)?

If there is some simple and straight answer( for both FB and VB), do let me know.

Thanx
Sunny
Back to top
View user's profile Send private message

jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Mon Dec 13, 2004 11:51 pm    Post subject:
Reply with quote

sunny,

Declare the first four bytes a different filed,

01 main-rec
05 first-four
05 remining
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Dec 14, 2004 2:31 pm    Post subject:
Reply with quote

Hi masade,
What u said is the case for VB which i think i suggested in my question itself.
I am asking for finding the length of FB too.
Is there any other method to find the length of records of VB format???
thanks for ur quick response masade...hope u give me some good suggestion.
Thanx
sunny
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Wed Dec 15, 2004 1:06 am    Post subject:
Reply with quote

Sunny,

I am sorry, I didn't pay attention while answering.

you want to know the length of a FB. does that mean you want to find out how many characters of data is present.

01 ws01-Name pic x(20) value 'ABCDE'.

in the above you want to say the length is 5? or 20?

if you want complete record length, you can use Length of

ws-length = Length of ws01-name. this gives you the value 20
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 15, 2004 5:59 am    Post subject:
Reply with quote

Hi Sunny,

Here's another approach for V/VB recs. Syntax is approximate since I don't have a manual handy.

In the FD code: RECORD VARYING FROM x TO y DEPENDING ON
WS-REC-LEN

Define WS-REC-LEN as 9(005) (think it can be COMP or COMP-3; vaguely remember can't have sign.)

Read a rec. WS-REC-LEN will contain the length of the rec just read. If you want to write the rec to an OP file, define it with the VARYING/DEPENDING ON too. If you want to change the length just move the new len to WS-REC-LEN (or the OPs own field) before you do the WRITE.

The only way to get the len of a F/FB rec is to follow the cntl block chain to the DCB or write an assembler pgm annnd issue a RDJFCB macro.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Wed Dec 15, 2004 11:46 am    Post subject:
Reply with quote

Hi Sunny,

RDW contains the record length of a VB record. You can use following job to get the length of individual record in VB File. I got this solution from one of the gods of mainframe world.

Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  VBS input file
//SHOW DD SYSOUT=*
//TOOLIN DD *
  DISPLAY FROM(IN) LIST(SHOW) ON(VLEN) BLANK
/*


regards,
Sandip.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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