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 extract portions of a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Tue May 22, 2007 1:38 am    Post subject: How to extract portions of a field
Reply with quote

Please help....
I have input record and want to reformat the FIRST-NAME field to remove the blanks between FIRST-NAME and INITIAL. Everything else should remain in teh same position.
We do not have the SQZ option so I would prefer to use OUTREC if possible...as I'm just learning that option

INPUT LRECL = 188 RECFM=FB
Code:
                               
00002JAMES         AMONG           WILKERSON OB/GYN             
00003HUGH          JGRANT          USE # 139410                 
00006JOE           CELLINGTON      KERNODLE CLINIC               
 


Output to hopefully look like this LRECL = 188 RECFM=FB
Code:
                               
DO00002JAMES A        MONG           WILKERSON OB/GYN             
DO00003HUGH J         GRANT          USE # 139410                 
DO00006JOE C          ELLINGTON      KERNODLE CLINIC               
 


I'm just learning OUTREC, but do not know how to remove blanks/spaces
Code:

OPTION COPY             
OUTREC FIELDS=(1:C'DO',
               3:1,5,   
              8:6,15, 
            .
               .
               .
           and so on
)
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: Wed May 23, 2007 5:23 am    Post subject:
Reply with quote

Hello,

If this is something you need soon, i'd suggest putting together a small program to do this. I'm not sure that OUTREC will do what you want. Also, consider that when there is any additional requirement, you may need to write code then.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed May 23, 2007 12:17 pm    Post subject:
Reply with quote

srj1957,

I feel INREC IFTHEN should do the trick (squeeze of spaces) for you. For ref, go thru the following link -

http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ICE1CA20/10.5.14?DT=20060615185603
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: Wed May 23, 2007 7:06 pm    Post subject:
Reply with quote

Hello,

I must admit to being confused icon_smile.gif

Please clarify how the info at that link will remove an unspecified number of embedded spaces from a "field" icon_confused.gif
Back to top
View user's profile Send private message
srj1957

New User


Joined: 15 Dec 2005
Posts: 72
Location: RALEIGH NC, USA

PostPosted: Thu May 24, 2007 1:05 am    Post subject: Re: How to extract portions of a field
Reply with quote

I'm sure it can be done with DFSORT but a bit cumbersome...

I wrote a "quick n dirty" COBOL pgm, which I was hoping to avoid doing

Thanks for your input...
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: Thu May 24, 2007 1:33 am    Post subject:
Reply with quote

You're welcome icon_smile.gif

Also, thank you for posting your solution.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu May 24, 2007 9:55 am    Post subject:
Reply with quote

Dick,

Quote:
Please clarify how the info at that link will remove an unspecified number of embedded spaces from a "field"


I had provided a sample code (whcih was not tested), but I feel it should work.

Code:

//SYSIN DD *
   INREC IFTHEN=(WHEN=(2,1,CH,EQ,C' '),
                           OVERLAY=(3:20,1,         * MOVE INITIAL
                           20:C' ')),      * REASSIGN INITIAL
             IFTHEN=(WHEN=(3,1,CH,EQ,C' '),
                           OVERLAY=(4:20,1,         * MOVE INITIAL
                            20:C' ')),      * REASSIGN INITIAL
                       ........
                       ........
   OPTION COPY
   OUTREC FIELDS=(C'DO',            * ADD 'DO' AT THE BEGIN
                              1,N)               * REMAINING RECORD
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon May 28, 2007 1:01 am    Post subject:
Reply with quote

Quote:
We do not have the SQZ option so I would prefer to use OUTREC if possible...as I'm just learning that option


SQZ is a parameter of OUTREC (=BUILD). With DFSORT's SQZ function, you could do it like this:

Code:

  OPTION COPY                         
  INREC BUILD=(1:C'DO',               
    3:1,5,                             
    8:6,15,SQZ=(SHIFT=LEFT,MID=C' '), 
    23:...)


You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's SQZ function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free).

You could probably do the same thing with a lot of IFTHEN statements, but it would be better to get your System Programmer to install the PTF so you can use SQZ.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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