Hi,
how to find the lenght of each record for variable file
say
123445678
123467
1234
i want th record count and byte count for this variable length file in SAS.pls help
SAS + to find thr number of length in a variable record
-
- Posts: 35
- Joined: Wed Oct 08, 2008 11:39 am
- Skillset: cobol, dn2, jcl, adabas, roscoe
- Referer: FRIEND
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: SAS + to find thr number of length in a variable record
Code: Select all
DATA A;
INFILE ???????? LENGTH=RL;
INPUT @;
RECLEN = RL ;
LENGTH DATALINE $ 32760;
INPUT @001 DATALINE $VARYING. RECLEN ;
-
- Posts: 3
- Joined: Fri Mar 12, 2010 12:25 pm
- Skillset: [url=http://www.r4cards.co.uk/]iedge[/url]
- Referer: GOOGLE
Re: SAS + to find thr number of length in a variable record
variable labels to files;
do i=1 to n;
labpos=pos(i)+floor((lens(i)-
length(left(varlabel(dsid,i))))/2);
rc=fpos(fid1,labpos);rc=fpos(fid2,labpos);
rc=fput(fid1, varlabel(dsid,i));
rc=fput(fid2, varlabel(dsid,i));
end;
rc=fwrite(fid1,’0’); rc=fwrite(fid2,’0’);
do i=1 to n;
rc=fpos(fid1,pos(i));rc=fpos(fid2,pos(i));
rc=fput(fid1, repeat(’-’,lens(i)-1));
rc=fput(fid2, repeat(’-’,lens(i)-1));
end;
rc=fappend(fid1); rc=fappend(fid2);
do i=1 to n;
labpos=pos(i)+floor((lens(i)-
length(left(varlabel(dsid,i))))/2);
rc=fpos(fid1,labpos);rc=fpos(fid2,labpos);
rc=fput(fid1, varlabel(dsid,i));
rc=fput(fid2, varlabel(dsid,i));
end;
rc=fwrite(fid1,’0’); rc=fwrite(fid2,’0’);
do i=1 to n;
rc=fpos(fid1,pos(i));rc=fpos(fid2,pos(i));
rc=fput(fid1, repeat(’-’,lens(i)-1));
rc=fput(fid2, repeat(’-’,lens(i)-1));
end;
rc=fappend(fid1); rc=fappend(fid2);
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Convert fixed-length input records to variable-length output
by xcspg3 » Wed Oct 23, 2024 1:45 pm » in DFSORT/ICETOOL/ICEGENER - 5
- 1394
-
by sergeyken
View the latest post
Wed Oct 30, 2024 1:09 pm
-
-
-
Merge multiple fixed length files of different record length
by corvette1982 » Mon Mar 01, 2021 11:46 pm » in JCL - 8
- 5200
-
by willy jensen
View the latest post
Tue Mar 02, 2021 3:02 am
-
-
- 14
- 8024
-
by indianrajput
View the latest post
Wed Nov 24, 2021 11:33 pm
-
- 5
- 3983
-
by sergeyken
View the latest post
Wed Jun 16, 2021 6:23 pm
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4078
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-