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
 

 

Check if a field is empty.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Check if a field is empty.
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    Post subject:
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    Post subject: Re: jcl - urgent
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    Post subject: Re: Check if a field is empty.
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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