BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

I am reading a variable length file delimited by hex 00 on mainframe. I notice my SAS program is skipping every other record in the file. The record format is VB. Record length is defined as 1000. When I browse the file, I see that its record length is 996. But I changed the in_rec to char996 and the same thing happened.

Any input would be greatly appreciated!!

DATA A;
INFILE IN1;
INPUT @1 IN_REC $CHAR1000.;

NEW1 = TRANSLATE(IN_REC,"~","00"X);
FILE OUT1;
PUT @1 NEW1;
RUN;

Here is the Input File:

0000000010.N.N.GC..GRODBI.1994-08-09.1994-08-09-09.06.17.002043.1994-08-09...cod
0000000010.N.N.HD..GROSAH.2002-06-05.2002-06-05-11.37.30.001991.2002-06-05...NAT
0000000011.Y.N.CF..MDVNKB.2002-11-12.2002-11-12-15.51.09.002000.2002-11-12.MDVNK
0000000011.Y.N.CF..MDVNKB.2007-01-22.2007-01-22-14.42.09.001995.2007-01-22.MDVNK
0000000011.Y.N.GC..MDVAGS.2007-09-19.2007-09-19-11.44.01.001991.2007-09-19.MDVAG
0000000016.Y.N.PM..ASD.1999-03-24.1999-03-24-16.04.58.002104.1999-03-24.ASDJHD..
0000000016.Y.N.GC..UDVWAC.2000-01-20.2000-01-20-15.54.34.002024.2000-01-20.RESEA
0000000016.Y.N.PM..DUASCR.2000-10-11.2000-10-11-10.22.55.002008.2000-10-11.DUASC



Here is the output file:

0000000010~N~N~HD~~GROSAH~2002-06-05~2002-06-05-11.37.30.001991~2002-06-05~~~NAT
0000000011~Y~N~CF~~MDVNKB~2007-01-22~2007-01-22-14.42.09.001995~2007-01-22~MDVNK
0000000016~Y~N~PM~~ASD~1999-03-24~1999-03-24-16.04.58.002104~1999-03-24~ASDJHD~~
0000000016~Y~N~PM~~DUASCR~2000-10-11~2000-10-11-10.22.55.002008~2000-10-11~DUASC
1 REPLY 1
data_null__
Jade | Level 19
I would try TRUNCOVER INFILE statement option.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 687 views
  • 0 likes
  • 2 in conversation