IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Check if a field is empty.


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Wed Aug 17, 2005 12:09 pm
Reply with quote

I have a requirement where a file is of lrecl = 1500,
i have to check if a partucular field is empty and if it's empty I have to populate that field by some default value else I have to leave as it is

eg:
fld1 field2 ...........
suppose field2 is empty I have to populate it with some default value, else
if it has some value, leave as it is.
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Wed Aug 17, 2005 12:51 pm
Reply with quote

Hi

This is possible using SORT with INREC.
Please refer following piece of code:
Code:

----------------------------------------------------------------
INREC FIELDS=(1,9,10,1,                               
              CHANGE=(1,C' ',C'U'),NOMATCH=(10,1),     
              11,69)
----------------------------------------------------------------


1. This code, will not change 1-9 bytes.
2. At 10th byte,with length 1, if the byte is " "(space), make it "U",
otherwise it will be as it was before
3. Rest of the bytes from 11 to end will be same.

If you have any more doubts, revert back

Thanks And Regards
Vamshi
Back to top
View user's profile Send private message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Wed Aug 17, 2005 2:52 pm
Reply with quote

Hi VAmshi,

Thanks a lot for ur help
onoe doubt
Posted: Wed Aug 17, 2005 12:21 pm Post subject:

--------------------------------------------------------------------------------

Hi

INREC FIELDS=(1,9,10,1,
CHANGE=(1,C' ',C'U'),NOMATCH=(10,1),
11,69)
----------------------------------------------------------------

here what is the limit po length of the field that is going to be replaced
eg. u r replacing by 'u' which is of length 1, can the length of the field, be 100. I think the limit is only 64.

In my cazse:
my field that is to be replaced is of length 100 chars.
so,
INREC FIELDS=(1,9,10,1,
CHANGE=(100,C' ',C'default value'),NOMATCH=(10,100),
11,69)

Please let me know ur suggestion and comments
----------------------------------------------------------------
Back to top
View user's profile Send private message
mainframesguru

New User


Joined: 24 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Wed Aug 17, 2005 6:42 pm
Reply with quote

Hi,

Sorry, I dont have answer for your question,about replacing by 100
characters.

Can you please let me know, how you are going to give 100 characters
default value in 80 Record-Length JCL.

Thanks And Regards
Vamshi
ICC-ISH
Chennai
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts How to check whether who renamed the ... JCL & VSAM 3
Search our Forums:

Back to Top