DATA Step, Macro, Functions and more

Read VSAM KSDS and create a SAS Dataset

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

Read VSAM KSDS and create a SAS Dataset

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

 


Accepted Solutions
Solution
‎09-20-2016 12:26 PM
Super User
Posts: 6,963

Re: Read VSAM KSDS and create a SAS Dataset

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Solution
‎09-20-2016 12:26 PM
Super User
Posts: 6,963

Re: Read VSAM KSDS and create a SAS Dataset

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 12

Re: Read VSAM KSDS and create a SAS Dataset

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

 

Jim Glover

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 189 views
  • 0 likes
  • 2 in conversation