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
 

 

How to remove . from mainframe datasets using selcopy code?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
RANGANATHAGOPAL

New User


Joined: 22 Oct 2007
Posts: 1
Location: chennai

PostPosted: Tue Oct 30, 2007 4:30 pm    Post subject: How to remove . from mainframe datasets using selcopy code?
Reply with quote

How to remove . from mainframe datasets using selcopy code?

eg:-
in dataset a record is like that

Input
A.100.89.90.87MAINFRAME IS G.OD TO WORK.

My Expected Output In DAataset is
A100899087MAINFRAME ID GOD TO WORK
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Tue Oct 30, 2007 4:38 pm    Post subject: Reply to: How to remove . from mainframe datasets using selc
Reply with quote

selcopy is not a general use program,

why not look at the manual

http://www.cbl.com/selcdoc.html
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Oct 30, 2007 4:38 pm    Post subject: Reply to: How to remove . from mainframe datasets using selc
Reply with quote

RANGA,

You can use the SQZ function with PREBALNK of DFSORT for your requirement. Also please search in this forum as this has been discussed before.

Quote:
using selcopy code?


what is selcopy code?
Back to top
View user's profile Send private message
Nick Jones

New User


Joined: 28 Apr 2009
Posts: 13
Location: UK

PostPosted: Wed Apr 29, 2009 2:55 pm    Post subject: Reply to: How to remove . from mainframe datasets using selc
Reply with quote

The answer to the original question "How to remove . from mainframe datasets using selcopy code?"

I can see that this is an old post, but for those who haven't heard of SELCOPY or would like to see how this task is achieved using SELCOPY...

SELCOPY syntax to do this is as follows...

Code:
read indd     * Read next input record.

** Loop to remove dots from all positions of the record except the last. **
@dot = 1      * Initialise pointer to 1st byte of input record.
==loop==
if @dot < lrecl                              * Verify pointer is in the record data. 
and pos @dot, lrecl = "."  ptr=@dot          * Find "." and upd pointer to this pos.
  then move from @dot+1, lrecl  to  @dot     * Shift remainder of record left 1.
  then lrecl = lrecl-1                       * Reduce the record length by 1.
  then goto loop                             * Locate next "."

** Now cater for "." in last position of record. **
if pos lrecl = "."
  then if lrecl = 1                          * Length of record is 1.
           then pos lrecl = " "              * Blank. (Cannot have zero length record.)
           else lrecl = lrecl-1              * Reduce record length by 1.

write outdd    * Write the record without the dots to the output data set.
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Wed Apr 29, 2009 7:15 pm    Post subject: Question: How to remove . from mainframe datasets using selc
Reply with quote

Hi Nick ,

Have tried your logic , but it did not work .
The output still shows the 'dots' .

I have added as below .

OPTION WORKLEN=9999
EQU IN-REC0 POS = 1
MAINPARA
READ INFILE INTO IN-REC0
IF POS LRECL = "."
THEN IF LRECL = 1
THEN POS LRECL = " "
ELSE LRECL = LRECL-1
WRITE OUTFILE FROM IN-REC0
GOTO MAINPARA

Is there any thing I am missing here ?
Back to top
View user's profile Send private message
Nick Jones

New User


Joined: 28 Apr 2009
Posts: 13
Location: UK

PostPosted: Wed Apr 29, 2009 8:45 pm    Post subject: How to remove . from mainframe datasets using selcopy code?
Reply with quote

Gousiya,

It looks like you've missed out a large section of the code. (The section beginning =loop= for example.)

In this case, use of a WORKLEN is unnecessary.
Note that SELCOPY will automatically loop to the start of the control statements to read the next record so the "MAINPARA"/ "GOTO MAINPARA" is also unnecessary. (Process looping stops when EOF of INFILE is reached.)

I have, however, amended the code slightly since my last posting.
Try to copy/paste the code below into your ISPF (or other) Edit session and run the job again.

If you still have problems, email your SYSPRINT output to me at the SELCOPY support desk (email address is at the selcopy.com web site.)

Code:
read indd     * Read next input record.

** Loop to remove dots from all positions of the record except the last. **
@dot = 1      * Initialise pointer to 1st byte of input record.
==loop==   
if pos @dot, lrecl = "."  ptr=@dot          * Find "." and upd pointer to this pos.
and @dot < lrecl                              * Verify pointer is in the record data.
  then move from @dot+1, lrecl  to  @dot     * Shift remainder of record left 1.
  then lrecl = lrecl-1                       * Reduce the record length by 1.
  then goto loop                             * Locate next "."

** Now cater for "." in last position of record. **
if pos lrecl = "."
  then if lrecl = 1                          * Length of record is 1.
           then pos lrecl = " "              * Blank. (Cannot have zero length record.)
           else lrecl = lrecl-1              * Reduce record length by 1.

write outdd    * Write the record without the dots to the output data set.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
No new posts Produce Mainframe Dash Board Reports ... sdcarlson53 All Other Mainframe Topics 2 Thu Jan 05, 2017 11:01 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am


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