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
 

 

Finding if a VSAM has null value records.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1511
Location: Chennai

PostPosted: Fri Aug 21, 2009 7:55 pm    Post subject: Finding if a VSAM has null value records.
Reply with quote

Hi,

I have a requirement in REXX to find if a record has any of the numbers from 1-9(except 0) in any position
and if the record has characters from A-Z in any position.

Code:
..................         -valid record
............00000000000..  -valid record
.....................      -valid record
//DLDOHI09 JOB CLASS=P,MS  -invalid record
00002028BC 1ABC-077        -invalid record
0000000920030111DUMMY FOR  -invalid record
0950200908191A 2009081718  -invalid record
110000001           19890  -invalid record
2009082018011900000000000  -invalid record
002006120950P700328GR B45  -invalid record
P188712200908191000020490  -invalid record
A 1                        -invalid record
0950008212009505655130352  -invalid record
                           -valid record
.........................  -valid record



If a record has 1-9 or A-Z in any place then the record has to be flagged invalid.
If a record has ....... or spaces or combination of them, then they have to be considered as valid.

I am trying to test the first record of a list of VSAM files if they have low value records or 000000's.

I tried the below code, but as you can see it is not capable to detecting records like " ....." or "0000...."
Could you please help.



Code:
      TEST_VALUE=SUBSTR(DATAS.1,1,30)                         
      TEST_VALUE2=C2X(TEST_VALUE)                                     
      SAY 'TEST_VALUE2 IS ' TEST_VALUE2                               
      IF (TEST_VALUE2 = 0 |,                                         
         TEST_VALUE = '000000000000000000000000000000') THEN         
      DO                                                             
        Q=Q+1                                                         
        MAKE.Q=FILE1 ' HAS NULL RECS'                                 
      END   




Thanks & Regards,
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Fri Aug 21, 2009 8:02 pm    Post subject: Reply to: Finding if a VSAM has null value records.
Reply with quote

Quote:
.......
means nothing, it' s just a way for ISPF to tell that the chars are not displayable

so it would be nice to specify better Your requirement icon_biggrin.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1511
Location: Chennai

PostPosted: Fri Aug 21, 2009 8:10 pm    Post subject:
Reply with quote

Oh!.. I missed that point.


By .... i mean only x'000000' icon_biggrin.gif .


x'000000' = valid.
other .... hex values are invalid.

Code:

With HEX on mode..
.............
0000000000000
0000000000000


Hex mode:

Code:
0000000000000...
FFFFFFFFFFFFF000
0000000000000000


is also valid.



The bottom line is to, test if a line has 1-9 or A-Z in any position or not.

Pls let me know if you need more information.

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Aug 21, 2009 8:19 pm    Post subject:
Reply with quote

I would TRANSLATE each line.
x'00' > x'00'
x'??' > x'31' where the ?? is everyother character except x'00'

then I would do a POS looking for x'31'.
When 0, then valid
otherwise invalid.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Fri Aug 21, 2009 8:29 pm    Post subject: Reply to: Finding if a VSAM has null value records.
Reply with quote

here is a code snippet that will check for any unwanted chars

Code:
samp.0 = 3
samp.1 = ",.:;)(/"
samp.2 = "..123"
samp.3 = "ABC.DE"

invchar = "123456789ABCDEF"
do   i = 1 to samp.0
   if  0 = verify(samp.i,invchar,"M") then ,
      say "    VALID" samp.i
   else ,
      say "NOT VALID" samp.i
end

Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1511
Location: Chennai

PostPosted: Fri Aug 21, 2009 8:49 pm    Post subject:
Reply with quote

Hi Enrico and DBZ,

Many Thanks for your help. I will cobble with the code given by Enrico.
It is sufficient for the requirement.

Thanks again,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Aug 21, 2009 8:57 pm    Post subject:
Reply with quote

Quote:
It is sufficient for the requirement.


actually, it is perfect.

I like giving solutions,
because enrico will always provide a more efficient solution.

I image VERIFY is much faster than TRANSLATE, POS.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1511
Location: Chennai

PostPosted: Fri Aug 21, 2009 9:05 pm    Post subject:
Reply with quote

Quote:
actually, it is perfect.


I totally agree..
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10292
Location: italy

PostPosted: Fri Aug 21, 2009 9:13 pm    Post subject: Reply to: Finding if a VSAM has null value records.
Reply with quote

oh, cm' on You wise guys icon_redface.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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts finding delayed job/s in OPC jzhardy IBM Tools 0 Mon May 29, 2017 9:04 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


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