BookmarkSubscribeRSS Feed
rohitkrishna
Calcite | Level 5

Hi All,

I'm facing one issue in current sas mainframe code while running the using option obs = 10 it extracting from 2 to 10 rec only means 9 rec only getting into the output in the log it shows "Invalid Parameter Name or Value" but remaining 9 rec are extracted only first rec itself showing that error, please find below the code and suggest sum solution for the problem 

 

options missing = ' ';
%Include MACRO(L*MDBSS);

%Include MACRO(L*MBDTE);

%L*MDBSS;

%L*MBDTE;

Proc Access Dbms=DB2;


Create adlib.SASV8*11.Access;
Ssid = &Xdbssid;
TABLE &XDBSSOWN..*L*8*11_ORG_N**E;
Assign=Yes;
List All;
/* Create View Defining the data from DB2 table */

Create vlib.SASV8*11.View;
Select ORG_ID
ORG_N**E
DE*T_N**E;

Run;

%Macro L*MV8*11(Viewid);

options obs = 10;
DATA _null_;

FORMAT Num8 8. Char8 $Char8.;
FORMAT recout $varying4000. len 5.;
RETAIN table '*L*8*11_ORG_N**E';
RETAIN Reccount 0;
RETAIN delimtr ',';
Reccount + 1;
SET Vlib.Sas&Viewid. END=EOF;

FILE LSFV8571;
If _N_ = 1 Then

LINK Header;

ORG_N**E = "'" || trim(ORG_N**E) || "'";
DEPT_N*m = "'" || trim(DEPT_N**E) || "'";

Org_N**e = TRANSLATE(Org_N**e,' ','00'x);
dept_n**e = TRANSLATE(dept_n**e,' ','00'x);

recout= 'D' || Delimtr ||
trim(left(Org_Id )) || Delimtr ||
trim(left(Org_N**e )) || Delimtr ||
trim(left(DEPT_N*M )) || Delimtr;

len = length(trim(recout));
PUT recout $varying4000. len;

If EOF Then
LINK Trailer;

Return;
/* Create Header. Format :- H LAMM 1997 355 .CXA 01.00 */
Header:

Hdte = "&Bdtejull";
Hdr_rec = 'HLAMM' || COMPRESS(HDTE) || '.CXA' ||
COMPRESS(SCAN(Sysparm(),3,'.'));

Hdr_rec = TRANSLATE(Hdr_rec,'.','/');

PUT @1 Hdr_rec;

File LSFHDATA;


Return;

Trailer:

* File LSFTDATA;
PUT @1 'T'
@2 Reccount Z10.;

Return;

/* Invoke the Macro to transform data */

%Mend;
Run;

%L*MV8*11(V8*11);

 

}

ERROR: ZIP191E Invalid Parameter Name or Value:
ZIP191E --> 504
ZIP191E Invalid Parameter Name or Value:
ZIP191E --> 'A 

 

the first record has missing in the output it shows above error so kindly help to resolve the problem

Thanks & regards 

rohit

4 REPLIES 4
ballardw
Super User

You have so many macro variables and macro references, none of which include any line using 504 or that are immediately obvious as creating or attempting to use a value of 'A, or using whatever ZIP191E maybe that I doubt that any specific response is possible.

 

You also say "the first record has missing in the output it shows above error so kindly help to resolve the problem" but do not indicate first record of what? There are multiple data sets referenced in the shown code. It would help reduce things a bit to know which set. Note that if the name of the data set is contained in one of the macro variables you should tell us which macro variable it has.

 

If you know what calls that ZIP191E then search in that code for when values are passed and trace backwards.

 

Possibly turning on the options MPRINT MLOGIC SYMBOLGEN may help with a log containing more details and where things are happening.

 

And then there is always the question: can you show us a version of the code that runs successfully that has NO macro variables or references>

Tom
Super User Tom
Super User

Is the issue that you wrote 10 lines to a file with a header row so that there are only 9 rows of actual data?

 

Why are you using OPTIONS OBS=10?  Also are you ever turning it off?

 

What is the purpose of the DATA _NULL_ step that is immediately after the OPTIONS OBS=10 statement? It seems to be generating a text file.  Why not just use the OBS=10 option on the input dataset in the SET statement of that step?

SET Vlib.Sas&Viewid.(obs=10) END=EOF;
rohitkrishna
Calcite | Level 5
Hi Tom,
thanks for the quick replay
but while coding (obs = 10) after the set statement also it shows same error
thanks & regards
rohit
ChrisNZ
Tourmaline | Level 20

I'm facing one issue in current sas mainframe code while running the using option obs = 10 it extracting from 2 to 10 rec only means 9 rec only getting into the output in the log it shows "Invalid Parameter Name or Value" but remaining 9 rec are extracted only first rec itself showing that error, please find below the code and suggest sum solution for the problem

 

I tried to understand the question, but is is as badly formatted as the code.

Please use punctuation, no SMS English, and re-read what you write like it is an essay you need marked.

As it is, your post's meaning is rather obscure. Why bother writing if you are unconcerned with getting your point across?

 

Same for the code. Save yourself (and us on this forum) some time and format your code properly.

A few seconds spent writing legible code will save you hours of debugging later on. I can guarantee that.

 

What's with all the stars in the code you posted?

And why didn't you use the {i} icon to paste the code?

And how do you expect us to know what an error featuring the string ZIP191E  means when this string is nowhere in your code?

And why don't you accept a solution when given one, like here or here?

 

In short: take the time and learn how to use this wonderful community.

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 870 views
  • 0 likes
  • 4 in conversation