Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Feild level validation to test first 5 are numbers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sruthi3466

New User


Joined: 23 Apr 2020
Posts: 1
Location: singapore

PostPosted: Thu Apr 23, 2020 2:47 pm    Post subject: Feild level validation to test first 5 are numbers
Reply with quote

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
View user's profile Send private message

Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Thu Apr 23, 2020 3:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Apr 23, 2020 4:23 pm    Post subject: Re: Feild level validation to test first 5 are numbers
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2407
Location: Hampshire, UK

PostPosted: Thu Apr 23, 2020 4:35 pm    Post subject: Reply to: Feild level validation to test first 5 are numbers
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Apr 24, 2020 5:13 am    Post subject:
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Fri Apr 24, 2020 12:44 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Second way to to include using SS

Mind sharing this approach?
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Fri Apr 24, 2020 4:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Apr 24, 2020 7:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Apr 24, 2020 7:54 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 311
Location: Bamberg, Germany

PostPosted: Fri Apr 24, 2020 9:06 pm    Post subject:
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Fri Apr 24, 2020 11:56 pm    Post subject:
Reply with quote

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. icon_smile.gif

That's always true for everyone, No exception whatsoever,. Learning never stops if desired. 2014.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts a copybook getting improper values in... Mahammad Musthafa COBOL Programming 7 Sat Jul 18, 2020 12:58 am
No new posts Problème reproducing a production bu... ELLAHEYA ABENDS & Debugging 1 Mon Jun 15, 2020 7:05 pm
No new posts Related to performing validation of f... Kumar Sandeep DFSORT/ICETOOL 19 Fri Apr 24, 2020 5:44 pm
No new posts Scripting TSO TEST Harold Barnes CLIST & REXX 3 Wed Apr 15, 2020 7:19 am
No new posts TSO TEST writing to dataset Harold Barnes IBM Tools 3 Sat Aug 03, 2019 3:02 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us