View previous topic :: View next topic
|
Author |
Message |
srj1957
New User
Joined: 15 Dec 2005 Posts: 72 Location: RALEIGH NC, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I must admit to being confused
Please clarify how the info at that link will remove an unspecified number of embedded spaces from a "field" |
|
Back to top |
|
|
srj1957
New User
Joined: 15 Dec 2005 Posts: 72 Location: RALEIGH NC, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Also, thank you for posting your solution. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|