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
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?
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.
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
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
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 ?
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.
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
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!
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.