Trying to read in a mainframe VSAM KSDS dataset and create a SAS dataset for further processing. Job runs and shows that it created observations, but all of them are empty. I am trying to put the entire record in 1 large variable. See code below:
FILENAME ASGIN 'GLOBAL.VIEWVDR.PROD.VIEWJCL.INDIST1' ;
DATA ASGOUT.INDIST1 ;
INFILE ASGIN VSAM ;
INPUT
@01 DATA $CHAR1060. ;@01 DATA $CHAR1060. ;
RUN;
The vsam file has a record length of 1060. Output from the job listed below:
1 FILENAME ASGIN 'GLOBAL.VIEWVDR.PROD.VIEWJCL.INDIST1' ;
2 DATA ASGOUT.INDIST1 ;
3 INFILE ASGIN VSAM ;
4 INPUT
5 @01 DATA $CHAR1060. ;@01 DATA $CHAR1060. ;
6 RUN;
NOTE: THE INFILE ASGIN IS:
DSNAME=GLOBAL.VIEWVDR.PROD.VIEWJCL.INDIST1,
VOLUME=ASG603,DISP=SHR,UNIT=3390,TYPE=INDEXED,
SPANNED=NO,RECORDSIZE=(.,1060),AMP=('AMORG'),
RECORDS=29597,KEYS=(60 0)
NOTE: 29597 RECORDS WERE READ FROM THE INFILE ASGIN.
THE MINIMUM RECORD LENGTH WAS 66.
THE MAXIMUM RECORD LENGTH WAS 810.
NOTE: THE DATA SET ASGOUT.INDIST1 HAS 29597 OBSERVATIONS AND 1 VARIABLES.
NOTE: COMPRESSING DATA SET ASGOUT.INDIST1 DECREASED SIZE BY 98.25 PERCENT.
COMPRESSED IS 10 PAGES; UN-COMPRESSED WOULD REQUIRE 570 PAGES.
Any ideas on what is wrong with this?? I ran an IDCAMS to verify there is data in the vsam file, and show data for all records.
Thanx,
Jim Glover
The key is this:
THE MINIMUM RECORD LENGTH WAS 66.
THE MAXIMUM RECORD LENGTH WAS 810.
This shows that the infile has variable-length records, all of which are shorter than your informat. In this case, SAS sets the variable to missing.
Use the truncover option in the infile statement, so SAS fills the variable with all available data instead.
The key is this:
THE MINIMUM RECORD LENGTH WAS 66.
THE MAXIMUM RECORD LENGTH WAS 810.
This shows that the infile has variable-length records, all of which are shorter than your informat. In this case, SAS sets the variable to missing.
Use the truncover option in the infile statement, so SAS fills the variable with all available data instead.
Looks like it worked great, Thanx for the assist!!!!!
Jim Glover
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.