|
View previous topic :: View next topic
|
| Author |
Message |
sruthi3466
New User
Joined: 23 Apr 2020 Posts: 1 Location: singapore
|
|
|
|
Hi,
I have a file containing lot of fields. The first field is fixed set of say 10 characters. My requirement is out of the 10 characters the first 5 should be always numeric.
Incase they are not number, I should be able to write those lines to a different file.
Eg:
12345iam
6789#how
89012wha
12345678
hi123how
Here the 2nd & 5th rows are invalid as the first 5 should be numeric. Hence want this to be written into a different file.
Requesting for an early reply.
Thanks
Sruthi |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1427 Location: Bamberg, Germany
|
|
|
|
You can request what you want. Show us what you have tried so far and you may get an answer. Beside that I can't see what it has to do with JCL or VSAM.
Use Code tags next time when posting data. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| sruthi3466 wrote: |
| Incase they are not number, I should be able to write those lines to a different file. |
To do this, you must be able to create some code for any of programming language and/or programming tool.
1) What programming languages you know?
2) What programming tools you know?
3) What do you know about JCL?
4) What do you know about VSAM? |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Put it this way:
1 - I suspect, but do not know, that you are wanting a sort solution but you a) failed to mention this and b) did not post in either sort section of the forum
2 - If you want it quick then do not post on a forum - the people responding do so in their spare time. Their time may be precious so you should present your query fully and clearly and accurately
3 - data and code should be presented using the code tags - you can figure out for yourself how to do this if you use the POST REPLY button and/or read form posts telling you how to do this
4 - zOS data is kept in data sets - hence DSN for Data Set Name - not files. In zOS a file is the stream of data from a data set or device (such as a modem) to your program
5 - Welcome to the Expert Forum. If you are inexperienced then the sister forum - Beginners Forum - would be a more appropriate place to post your questions.
6 - Links to manuals can be found at the very top of each page or you can Google for them. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
There are many ways - I assume the field starts 1-10 byes.
One way to try is this ,
| Code: |
| INCLUDE COND=(1,5,FS,EQ,NUM) |
Second way to to include using SS |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1427 Location: Bamberg, Germany
|
|
|
|
| Rohit Umarjikar wrote: |
| Second way to to include using SS |
Mind sharing this approach? |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| Rohit Umarjikar wrote: |
There are many ways - I assume the field starts 1-10 byes.
One way to try is this ,
| Code: |
| INCLUDE COND=(1,5,FS,EQ,NUM) |
|
1) This approach has nothing to do with neither JCL, nor VSAM, - as required by the chosen forum.
2) depending on actual criteria (not clear from the TS explanation) it might be also
| Code: |
| INCLUDE COND=(1,5,ZD,EQ,NUM) |
3) if splitting to different files is required, need to be changed
| Code: |
. . . . .
OUTFIL FNAMES=GOODDATA,
INCLUDE=(1,5,ZD,EQ,NUM)
OUTFIL FNAMES=BADDATA,
SAVE
|
|
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Joerg.Findeisen wrote: |
| Rohit Umarjikar wrote: |
| Second way to to include using SS |
Mind sharing this approach? |
| Code: |
INCLUDE COND=(1,1,SS,EQ,C'0123456789', AND,
2,1,SS,EQ,C'0123456789', AND,
3,1,SS,EQ,C'0123456789', AND,
4,1,SS,EQ,C'0123456789', AND,
5,1,SS,EQ,C'0123456789') |
|
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| sergeyken wrote: |
| Rohit Umarjikar wrote: |
There are many ways - I assume the field starts 1-10 byes.
One way to try is this ,
| Code: |
| INCLUDE COND=(1,5,FS,EQ,NUM) |
|
1) This approach has nothing to do with neither JCL, nor VSAM, - as required by the chosen forum.
2) depending on actual criteria (not clear from the TS explanation) it might be also
| Code: |
| INCLUDE COND=(1,5,ZD,EQ,NUM) |
3) if splitting to different files is required, need to be changed
| Code: |
. . . . .
OUTFIL FNAMES=GOODDATA,
INCLUDE=(1,5,ZD,EQ,NUM)
OUTFIL FNAMES=BADDATA,
SAVE
|
|
1. It should be moved to DFSORT/ SYNCSORT based on the product TS uses.
2.It could be FS or ZD, TS would need to decide that, I assumed FS since it was not provided.
3. I just gave an idea and not the complete solution since TS is expected to do that at the least. |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1427 Location: Bamberg, Germany
|
|
|
|
| Rohit Umarjikar wrote: |
| Code: |
INCLUDE COND=(1,1,SS,EQ,C'0123456789',AND,
2,1,SS,EQ,C'0123456789',AND,
3,1,SS,EQ,C'0123456789',AND,
4,1,SS,EQ,C'0123456789',AND,
5,1,SS,EQ,C'0123456789') |
|
Thank you. I was guessing this would be your solution but sometimes an old dog learns new tricks.  |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Joerg.Findeisen wrote: |
| Rohit Umarjikar wrote: |
| Code: |
INCLUDE COND=(1,1,SS,EQ,C'0123456789',AND,
2,1,SS,EQ,C'0123456789',AND,
3,1,SS,EQ,C'0123456789',AND,
4,1,SS,EQ,C'0123456789',AND,
5,1,SS,EQ,C'0123456789') |
|
Thank you. I was guessing this would be your solution but sometimes an old dog learns new tricks.  |
That's always true for everyone, No exception whatsoever,. Learning never stops if desired.  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|