|
View previous topic :: View next topic
|
| Author |
Message |
Piyush Jadhav
New User
Joined: 06 Feb 2014 Posts: 7 Location: India
|
|
|
|
Hi,
I am trying to get the words in string of line from below input into different variables so that I can search those in next step. I am doing it using PARSE keyword in JCL SORT.
Not getting what I am missing here or any particular syntax would help me in getting this.
My input is (USSTCP is only constant, rest is varying in text and in length as well).
USSTCP BSCUSS6A
USSTCP BSCUSS99 PQRS,PIYUSH
USSTCP BSCUSS34 ABCDE
USSTCP BSCUSS6A HOSTNAME,abcd.xyz.COM
I want output as -
BSCUSS6A
BSCUSS99 PQRS PIYUSH
BSCUSS34 ABCDE
BSCUSS6A HOSTNAME abcd.xyz.COM
I tried various SYSIN DD statements -
OUTFIL PARSE=(%=(ENDAT=C'USSTCP '),
%01=(STARTAFT=C',',ENDBEFR=BLANKS,FIXLEN=8)),
OUTFIL PARSE=(%01=(STARTAFT=C'USSTCP ',FIXLEN=8)),
I tried various PARSE keywords but didn't get luck to sort this out, if anyone help here please.
_________________
Regards,
Piyush. :-) |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| If you seek SORT advice, why posting in JCL & VSAM section of the forum? |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| You can simply strip the first part from the record using INREC here. |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| Please use the code tags when providing code/data next time. Also provide sample data for input and desired output. RECFM/LRECL of the input and such. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2290 Location: USA
|
|
|
|
| Joerg.Findeisen wrote: |
| If you seek SORT advice, why posting in JCL & VSAM section of the forum? |
| Quote: |
| Everything what is not COBOL supposed to be JCL! |
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2290 Location: USA
|
|
|
|
1. First of all, learn how to be polite to your readers:
| Piyush Jadhav wrote: |
Hi,
I am trying to get the words in string of line from below input into different variables so that I can search those in next step. I am doing it using PARSE keyword in JCL SORT.
Not getting what I am missing here or any particular syntax would help me in getting this.
My input is (USSTCP is only constant, rest is varying in text and in length as well).
| Code: |
USSTCP BSCUSS6A
USSTCP BSCUSS99 PQRS,PIYUSH
USSTCP BSCUSS34 ABCDE
USSTCP BSCUSS6A HOSTNAME,abcd.xyz.COM |
I want output as -
| Code: |
BSCUSS6A
BSCUSS99 PQRS PIYUSH
BSCUSS34 ABCDE
BSCUSS6A HOSTNAME abcd.xyz.COM
|
I tried various SYSIN DD statements -
| Code: |
OUTFIL PARSE=(%=(ENDAT=C'USSTCP '),
%01=(STARTAFT=C',',ENDBEFR=BLANKS,FIXLEN=8)),
|
| Code: |
| OUTFIL PARSE=(%01=(STARTAFT=C'USSTCP ',FIXLEN=8)), |
I tried various PARSE keywords but didn't get luck to sort this out, if anyone help here please.
_________________
Regards,
Piyush. :-) |
When done, then we can continue the "discussion".
2. Also it would be useful to find out: what is the difference between JCL, and SORT!!!
3. You are not using "different SYSIN DD statements", but different "SORT control statements"!!!
Those are "different SYSIN DD statements":
| Code: |
//SYSIN DD *
//SYSIN DD DUMMY
//SYSIN DD DISP=SHR,DSN=aaa.bbb.ccc
//SYSIN DD DDNAME=ANOTHER |
4. What does this mean - "get the words in string of line from below input into different variables" ?
Where are there any variables in your example??? |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2290 Location: USA
|
|
|
|
Discussions do not help when TS is not interested in learning something, including common terminology...
@Piyush: Not clear: how do you plan to fit your "abcd.xyz.COM" value into 8 characters field you are trying to reserve?
Try this:
| Code: |
INREC PARSE=(%1=(STARTAT=NONBLANK,
ENDBEFR=C',',ENDBEFR=BLANKS, USE EITHER SEPARATOR
FIXLEN=9, RESERVE 8 + 1 CHARACTER AS FURTHER SEPARATOR
REPEAT=10)), TOTAL 10 FIELDS, ONE TO IGNORE
* BUILD ALIGNED FIELDS, EXCLUDING #1
BUILD=(%2,%3,%4,%5,%6,%7,%8,%9,%10)
SORT FIELDS=COPY
END |
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1448 Location: Bamberg, Germany
|
|
|
|
| What puzzled me was the (not yet seen) second search step. Perhaps it renders the previous need for a parse operation obsolete. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|