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

Access library name in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
RBABU

New User


Joined: 23 Nov 2022
Posts: 5
Location: India

PostPosted: Wed Nov 23, 2022 4:18 pm
Reply with quote

Hi,
Nice to see you all for assisting. I am new to REXX.
Need REXX program for the below requirement.

Read input file(len=999, rec count=100). from 1 to 670 data in alpha numeric.
check @position 671 for number of counts. If entries greater than 0 then proceed to extract data.

If count is 2 then extract data from 2 positions
if count is 3 then extract data from 3 positions
If count is 0 then just move spaces.

Input file in Hex format:
00000B8E4440BB44440000444
02004B240004A500000000000

Input file 1 record given sample data starting from position 671 (hex format)

pos 671 to 672 in hex, the decimal value is 2(count)
pos 675 to 679 in hex, the decimal value is 79397604
pos 682 to 686 in hex, the decimal value is 79344960

There are spaces between 2 values, just ignore.

Output file looks like:
79397604 79344960

Would be appreciated if you could help to provide the code asap.

Kindly get back to me in case I am not making you clear. Thank you
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Fri Nov 25, 2022 2:02 am
Reply with quote

RBABU, please always start a new topic and use code tags when providing sample data or code.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Fri Nov 25, 2022 2:05 am
Reply with quote

Reply from Willy.

Quote:
A few things to start with:
Var1 = Substr(input,671,lenght(input) /* take all data till end of file */
'input' should be 'input.i' to get the stem
you should not have 'length(input)' as default is to the end. And you are missing an end paranthesis, so you must have had an error message.

pos= pos(j3,j2)
I don't see you seting j3 or j2 anywhere.
in general don't use the name of a function, like 'pos' as a variable. while it works, it is confusing.

if substr(pos,j) you should have a 3rd parameter '1'.

outfile.data I don't see you define 'data' anywhere.

else nop is superfluous and a waste of a line

j=j+1 I don't see you using j anywhere
_________________
WJ
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2133
Location: USA

PostPosted: Fri Nov 25, 2022 5:09 am
Reply with quote

After the latest clean-up of the topic it is now not possible to understand anything from the content left hereā€¦
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Fri Nov 25, 2022 8:33 am
Reply with quote

I would let TS explain again one time if still wants to peruse further but let us please stick to the problem and solution than sideways.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Fri Nov 25, 2022 9:36 am
Reply with quote

Quote:
@position 671


If I recall correctly, the poster was trying to do something too hard for a beginner. My suggestion is to start with a simple program then do incremental improvements as you get it to work. Use a smaller test data file, of shorter record length. Then write code to demonstrate that you can read and process all of the records. Add SAY statements to prove to yourself.

Then later switch to the longer record length, but with only a few data records (maybe up to 5 records). And be sure to you know which records have the desired data.

Then add the checks of data records that you are interested in.

Then switch to your actual data file.

Learn to use the TRACE command.
Back to top
View user's profile Send private message
RBABU

New User


Joined: 23 Nov 2022
Posts: 5
Location: India

PostPosted: Fri Nov 25, 2022 9:59 am
Reply with quote

Rohit Umarjikar wrote:
RBABU, please always start a new topic and use code tags when providing sample data or code.


Sure Rohit Sir. I will start new one. Many thanks
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
Search our Forums:

Back to Top