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
 

 

To get the length of the record?

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

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Thu May 11, 2006 6:42 pm    Post subject: To get the length of the record?
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    Post subject:
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    Post subject: Re: To get the length of the record?
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    Post subject: Record length greater than maxreclen, but truncation not
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    Post subject: Re: To get the length of the record?
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
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Fri May 12, 2006 10:49 am    Post subject: sort?
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    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 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 Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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