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

To get the length of the record?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajayvamsi

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Thu May 11, 2006 6:42 pm
Reply with quote

Hi Friends,
I have a variable file as follows..
Input file:
abcdef
abcdefg
abcdefgh
abcdefghijklm

Now I need to get the length of each record How is that possible?
outfile should be:
6
7
8
13

Please let me know if u need any information..!!

Thanks,
ajay
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Thu May 11, 2006 6:58 pm
Reply with quote

Hi Ajay,

If you're using a COBOL program read it to a working storage variable which is defined with a size equal to the size of the record length and try comparying 1 byte with SPACE from the end. For each iteration, increment one count and when it hits the first non space charater, subtract the counter from the record length and you've the value you're looking for !

Hope this makes sense!

Cheers, Twissi.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu May 11, 2006 9:54 pm
Reply with quote

Ajay,

Take a look at this link. It should explain how to get the length of a variable length record.

Data Division--File Description Entries

Go to Subtopics: RECORD Clause, Format 3, depending on data-name-1.

The size of your record just read will be put here

Questions?, Please come back

Dave
Back to top
View user's profile Send private message
segar

New User


Joined: 02 Oct 2005
Posts: 4

PostPosted: Thu May 11, 2006 10:28 pm
Reply with quote

I have file from unix transfer via xcom to Mainframe.
having return code =40 .
Record length greater than maxreclen, but truncation not allowed.

the job jcl as below


JSTEP20 EXEC LUS265,
RDEST=ASDC,
BZ0=32760,BZ1=23476,CL1=V,PA1=80,
PL='SPCS.XCOM',RG1=S,SA1=25,SS1=LCM,
UT1=POOLSG,UT2=SYSDA,UT3=CTAPE,
INQ='LJ46015.XCOMFILE',
XFILE='SLCM.LJSIP.CUSTFILE',
PM1=CLJS460E,
VS1=SPRDO4

Please help ,i need to fix it urgently.

advance thanks

segar
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu May 11, 2006 10:33 pm
Reply with quote

segar,

Please start another topic with this question. You're question is off topic here and will be better served as a stand alone.

Thanks,

Dave
Back to top
View user's profile Send private message
ajayvamsi

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Fri May 12, 2006 10:49 am
Reply with quote

Hi Friends,

The request I had put before u can be solved by program ofcourse but can u please help to solve this using SORT? will it be possible using sort?
actually for a variable record the length of the record will be present at the begining so is that sufficient to get that column ?

Please let me know if any concerns,
Thanks
ajay
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 -> COBOL Programming

 


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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top