BookmarkSubscribeRSS Feed
animesh123
Obsidian | Level 7

Trying to convert PD 6.2 to integer from mainframe to SAS EG environment.

PUT @0321 INC_AM PD6.2 @@;
IF MO_PMT_AM = . 
PUT @0327 '?' @@;
ELSE
PUT @0327 MO_PMT_AM PD6.2 @@;
IF PMT_AM = . 
PUT @0333 '?' @@;
ELSE
PUT @0333 PMT_AM PD4.8 @@;

5 REPLIES 5
Tom
Super User Tom
Super User

You will need to explain much more about what you are doing.

Do you have a BINARY file that has values in packed decimal that you want to READ?

Do you have a DATASET that you want to use to create a BINARY file that has packed decimal in it?

 

What does the front end tool Enterprise Guide have to do with the problem?

Where is the SAS sessions that you are using EG to create running?  Are they running on the same machine where you are running EG?  Or are you connecting to some server?  What operating system is that server running?

animesh123
Obsidian | Level 7

Do you have a BINARY file that has values in packed decimal that you want to READ?

Yes I have a binary file which is in the mainframe environment which I am reading and want to  migrate the same code into SAS EG environment and where I want to write.

 

But since the code is in Mainframe environment and wanting to rewrite the  the SAS code in SAS EG ,am facing issue with variable which contain PD 6.2  format

 

Kurt_Bremser
Super User

EG is only a frontend to the SAS system; the important fact is where the SAS workspace server runs.

Is the WS local on the same computer with EG, or on a remote server?

And if a remote server, which operating system? Windows, UNIX, or even the same mainframe you already use?

Note that the (syntactically invalid, BTW) example code you posted writes a file, it does not read it.

Please post the complete mainframe code which reads a file on the mainframe. 

animesh123
Obsidian | Level 7

This is how the code looks like.
I want to write the same code in Linux ,but variable which have PD6.2 and IB2value is not giving proper output.

DATA _NULL_;

SET PCE_PURCH ;

IF VALIDID = 'Y' THEN
DO;

FILE OUTFILE NOTITLES;
PUT @0309 MO_WRK_PER_YR_NB IB2. @@;
IF GRS_MO_INC_AM = . THEN
PUT @0311 '?' @@;
ELSE
PUT @0311 GRS_MO_INC_AM PD6.2 @@;
IF GRS_MO_INC_VRFY_AM = . THEN
PUT @0317 '?' @@;
ELSE

PUT @0321 OTH_MO_INC_AM PD6.2 @@;
Else
IF OTH_MO_PMT_AM = . THEN
PUT @0327 '?' @@;
ELSE
PUT @0327 OTH_MO_PMT_AM PD6.2 @@;
IF RENT_MTGE_PMT_AM = . THEN
PUT @0333 '?' @@;
ELSE
PUT @0333 RENT_MTGE_PMT_AM PD6.2 @@;
IF CNTRCT_MO_TERM_NB = . THEN
PUT @0339 '?' @@;

Kurt_Bremser
Super User

So you do not read a file, you write one.

Since you do run this code on a non-mainframe platform, using the S370... formats is in order:

S370FPDw.d Format 

S370FIBw.d Format 

 

Note that, for this to be read on the mainframe, all transfers have to be done in binary mode.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 851 views
  • 2 likes
  • 3 in conversation