BookmarkSubscribeRSS Feed
oht
Calcite | Level 5 oht
Calcite | Level 5

Hi,

We have ftp a file that contains paked decimal from Mainframe(MVS- no SAS) to unix using 'EXEC PGM=FTP'. Is there any way to convert the packed decimal to numeric or char in Unix ?

Thanks

7 REPLIES 7
Astounding
PROC Star

It's probably relatively easy.

Can you provide a few examples of what the data look like after being transferred (hex codes, please), and what values they should become?

Tom
Super User Tom
Super User

Just make sure to move the file as BINARY and not ASCII with FTP.

Then you should be able to read it with SAS using PD informat.

oht
Calcite | Level 5 oht
Calcite | Level 5

We did try to ftp in binary format and then use the SAS PD to read in the data. However, the pack decimal vaules all become missing.values.

We finally able to convert the pd to flat file with COBALT and then FTP and it works

Tom,Astounding, really thanks for your help

Peter_C
Rhodochrosite | Level 12

For future reference, PD OFF-mvs is not the same as PD ON-mvs

To read data in binary mvs PD format use the informat S370FPD.

There are several of these S370Fxxx formats designed to help with the task of reading ebcdic data (as well as $ebcdic itself)

not S3270FPD ( 3270 is an IBM terminal data ) Message was edited by: Peter Crawford

oht
Calcite | Level 5 oht
Calcite | Level 5

Thanks Peter, I am sorry I get confused with 'PD OFF-mvs is not the same as PD ON-mvs'  ? Do you mean I can read in the MVS PD data in unix using informat S370FPD if the file was FTP in binary ?

Tom
Super User Tom
Super User

That is what he meant.  There are a number of useful formats/informats that should allow you to both read and write data that can be moved to/from IBM mainframe.   For example I was just using the S370FIB to write binary integers with the byte order in the direction I wanted.

Peter_C
Rhodochrosite | Level 12

Thank you Tom

That is what I intended.

OHt

There are also some very useful papers on the support.sas.com website on the topic.

Peter

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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