View previous topic :: View next topic
|
Author |
Message |
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
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 |
|
|
twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
segar
New User
Joined: 02 Oct 2005 Posts: 4
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
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 |
|
|
|