Hi experts,
I have this value "-0000180" and i want to transform it into "000018p", where p simbolize the negative value for cobol according to this equivalents:
0=p 1=q 2=r 3=s 4=t 5=u 6=v 7=w 8=x 9=y
i have to sustitute the last digit of the negative value by the corresponding letter and keep the zeroes to the left, examples:
-000323 = 00032s
-000567 = 00056w
Do you have any idea to do it ?
Hi @Jose7,
The VMSZNw.d format looks promising:
50 data _null_; 51 array x[3] (-180 -323 -567); 52 put x1 z8. +1 x1 vmszn7. / 53 x2 z7. +2 x2 vmszn6. / 54 x3 z7. +2 x3 vmszn6.; 55 run; -0000180 000018p -000323 00032s -000567 00056w
I don't believe you need to do it manually. Have you looked at the S370 series of formats? Those are intended to be used for mainframe compatible numeric formats. I believe S370FPD would be the format you want.
Also, take a look at this link: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/p17nnhja9pspodn1k6nfdop68xwk.ht...
Jim
Hi @Jose7,
The VMSZNw.d format looks promising:
50 data _null_; 51 array x[3] (-180 -323 -567); 52 put x1 z8. +1 x1 vmszn7. / 53 x2 z7. +2 x2 vmszn6. / 54 x3 z7. +2 x3 vmszn6.; 55 run; -0000180 000018p -000323 00032s -000567 00056w
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.