Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10310
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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us