Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Converting non-editable character in a ps file to spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Converting non-editable character in a ps file to spaces
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

Site Director


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

PostPosted: Sun Sep 30, 2007 8:50 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Sun Sep 30, 2007 11:03 am    Post subject: Reply to: Converting non-editable character in a ps file to
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

Site Director


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

PostPosted: Sun Sep 30, 2007 12:27 pm    Post subject:
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: 1232
Location: Israel

PostPosted: Sun Sep 30, 2007 12:46 pm    Post subject:
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    Post subject: Reply to: Converting non-editable character in a ps file to
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: 2360
Location: Israel

PostPosted: Sun Sep 30, 2007 9:17 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us