BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gloveman71
Calcite | Level 5

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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.

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

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.

Gloveman71
Calcite | Level 5

Looks like it worked great,  Thanx for the assist!!!!!

 

Jim Glover

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
  • 972 views
  • 0 likes
  • 2 in conversation