BookmarkSubscribeRSS Feed
NinaLWerner
Calcite | Level 5

I am hoping that someone will have an old macro program to process my mainframe reports TXT output files and replace the 0 or 1 in column 1 [that was substituted for a real page feed/ line feed in the FTP process] with actual control codes, so I don't have to manually edit every page on these many legacy reports for which I have just become the steward.  Thanks!  I'm back on mainframe after twelve years or so on PC SAS.  It surprised me that the production process is:  FTP each report, then edit every single page to work in MS Word for printing, then create PDFs. Man Frustrated

2 REPLIES 2
NinaLWerner
Calcite | Level 5
DATA _NULL_ ;
	INFILE txtin;
	INPUT @1 xchr $1. @1 lnin $CHAR133.;
	LENGTH lnut $134;
		 IF xchr=' ' then lnut=lnin;
	ELSE IF xchr='0' then lnut=CATS('0A20'x, SUBSTR(lnin,2));
	ELSE IF xchr='-' then lnut=CATS('0A0A20'x, SUBSTR(lnin,2));
	ELSE IF xchr='1' then lnut=CATS('0C20'x, SUBSTR(lnin,2));

	FILE txtut;
	PUT lnut;
RUN; 

Not quite working.  I'm losing centered titles and not all formfeeds are being inserted.  Any thoughts?

 

NinaLWerner
Calcite | Level 5

I improved my result with INFILE txtin TRUNCOVER; to handle short rows.

I still need help getting the titles centered (or maintaining the tabs inserted in the TXT rows.)  Smiley Frustrated

I can provide a sample input file, if you have any ideas and would like to play with it.

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
  • 2 replies
  • 722 views
  • 0 likes
  • 1 in conversation