I am having a weird issue with the space in place of zeros for a varaible when I write out to a mf dataset. I get a variable and its value calling a IMS db in a data step, I am using same variable in another data step and the same varaible when I write out to a mainframe dataset is changing to a space.
Following is the sas code i used..
data have;,,
infile intxn;
input @001 txns_rec $238. @001 srvcr $6.
@007 lnno $9.
...
...
...
@161 slrname $30.
...
...
run;
I am getting couple of variables (groupno & lnany) from IMS db like below
***************************************************************;
* Read XXXXX segment using GU call *;
***************************************************************;
data want;
set have;
length SSA1 $60.;
database="&dbname";
callfunc='GU ';
SSA1='XXXXXX(XXX0010F ='||lnno||')';
input
@001 lnno $9.
@041 groupno $7.
@073 lnany pd4.6
;
put '--- LNNO# ---> ' lnno;
put '--- GROUP# ---> ' groupno;
put '--- ANY1# ---> ' lnany;
if statcode not in ( ' ', 'GE' ) then do;
put '--- error ---> ' _all_;
abort return 1111;
end;
run;
I am getting the values like below
--- LNNO# ---> 180878298
--- GROUP# ---> F193076
--- ANY1# ---> 0.05125
I am writitng these out to a dataset like below
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
* Write out warning file ;
*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
data _null_;
set want;
file wartxn;
put @001 srvcr $6.
@007 lnno $9.
....
....
....
@161 groupno $7.
....
....
....
@339 lnany S370FZDT10.9
....
....
.... @374 slrname $30.
;
run;
Follwoing is the output file values (in wartxn)
groupno value in a output dataset(wartxn): ----+----7--
************
F193 760310W The above value @161 pos, between F193 and 76 there is a space. it supposed to be F193076 for groupno as I printed that value right after IMS db call.
The lenght of output file(wartxn) that I am writting out to in a jcl is different(403) than the input file(238) because I am adding some variables at the end to the file. The interesting thing is when I write the groupno anywhere beyond 238, I do not see this problem.
I really apprecite your time, thanks in advance.
Neal.
... View more