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

How to remove . from mainframe datasets using selcopy code?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 30, 2007 4:38 pm
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: 1287
Location: Chennai, India

PostPosted: Tue Oct 30, 2007 4:38 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top