IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Converting non-editable character in a ps file to spaces


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Sun Sep 30, 2007 8:34 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Sep 30, 2007 8:50 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Sep 30, 2007 11:03 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Sep 30, 2007 12:27 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Sun Sep 30, 2007 12:46 pm
Reply with quote

The TAB character can easily be replaced by a space (or anything else) in edit:
Code:
C X'05' " " ALL

If you're not sure about the character itself, try:
Code:
C P'.' " " ALL
The P'.' means "invalid character" and refers to any non-displayable char.
Back to top
View user's profile Send private message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Sun Sep 30, 2007 8:32 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Sep 30, 2007 9:17 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top