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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts finding delayed job/s in OPC jzhardy IBM Tools 0 Mon May 29, 2017 9:04 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
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
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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