View previous topic :: View next topic
|
Author |
Message |
purushoth_jp
New User
Joined: 12 Dec 2004 Posts: 22
|
|
|
|
All,
My requirement is to upload an excell sheet to mainframes and do some operstions with that data in mainframes with the help of REXX. I followed the following steps to upload that sheet.
1) i saved that excell sheet with .txt.
2) uploaded the text file to a PS dataset in mainframes throgh ISPF Transfer file utility.
When i opened the PS file, there i saw each row in the excell sheet as one record and each column is seperated as space. as such the below pic
000001 S76Z067 7/5 8470 C1489560 - Record 1
000002 S76Z070 7/6 8470 C1490558 - record 2
i thought those seperators are spaces and i tried to delete those spaces manually. But those are non editable characters and when i tried to edit or type some characters in that space but it is not allowing me to type or delete that characters.
when i tried to read a particular field using some logic but it is displaying single record as sigle filed.
Is there is any way to convert the noneditable characters in that file to spaces. If so please let me know.
thanks in advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It is easier if you go back to the win-based system and save the data as a tab-delimited text file.
This may already be what you have. On the mainframe, the tab character (x'05') is non-displayable.
If you open your uploaded file in tso/ispf, go into browse, and look at your data with HEX ON, you will be able to see the characters that are between the data fields.
Depending on how the data is to be used on the mainframe, the tab characters should not cause any processing problems. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
I do not use EXCEL any more, but, if I remember correctly, there should be
an option to export the worksheets in CSV ( comma separated values ) format,
saving everybody the trouble of non displayable characters.
regards
e.s |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
One problem with csv files is that more and more, there are commas that are needed in uploaded data.
Depending on the code that buils the file for upload, i have found that the backslash (\) and tilde (~) work pretty well as they are rarely valid data content. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
The TAB character can easily be replaced by a space (or anything else) in edit:
If you're not sure about the character itself, try:
The P'.' means "invalid character" and refers to any non-displayable char. |
|
Back to top |
|
|
purushoth_jp
New User
Joined: 12 Dec 2004 Posts: 22
|
|
|
|
Thanks for everyone's help. I tried with what ever change command Marso has given it worked fine. Thanks Marso, it worked. I really appreciate your help in this regards.
Is there is any way that we can code this command in a REXX macro. I know that we can use Edit Macro but is it possible to call a edit macro through a rexx program instead of user typing this command or the edit macro name in the command line everytime when a new file is created. i.e my Aim is, user shold only upload the excell sheet to mainframes. Remaining things should be taken care by of REXX programs. Could you please help me out on how to use the change xommand in REXX pgms.
thanks in advance |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can invoke an ISPF Edit-macro programmatically. You do this using the EDIT or VIEW ISPF services with the MACRO operand.
For example: ADDRESS ISREDIT "EDIT DATASET(&MYDS) MACRO(REMOVE)". At the end of processing (in the edit macro), don't forget to issue ADDRESS ISREDIT END or CANCEL.
By the way, if you need to issue lots of ISREDIT commands in a loop, a macro written in a compiled language (like COBOL) is much faster.
O. |
|
Back to top |
|
|
|