View previous topic :: View next topic
|
Author |
Message |
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
Hi ,
I have a requirement in Rexx
I need to convert MAP cd x(3) (COMP-3 variable)
Eg ' ' should be converted to '....................'(20 characters)
I can be able to do this in rexx. But my requirement is to call this in JCL.
How to call this rexx module in JCL???
For eg if input file has 133333333 1 ' '
output file should be 133333333 1 '....................'.
I tried (11,3,ZD) But resulted in 133333333 1 '404040'.
Any solution to this..??? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Welcome to the forums. Please learn to post your request in the correct forum.
Also, the topic of running a REXX program in batch has been discussed many times and lots of examples on how to are included.
There is a search button at the top of almost every page. Please search the forums before posting. |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
Thanks expat
In rexx
X2B(04000) is yielding 00000100000000000000
and
X2B(04400) 00000100010000000000
and I am
getting correct result
How can we accomplish in JCL?
I tried this. But I got only spaces in output file
if first five positions in input had '04000'
OUTREC FIELDS=(1,5,ZD,TO=BI,LENGTH=20)
Ø (Normal mode)
00000000000000000038
00000000000000000180(Hex mode).
Am I making mistake? Please help me out. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
It appears that you want to convert "nibbles" into their corresponding 1/0's. Is this true?
Your input is not ZD (zoned decimal), so that specification will not work.
Do you have 2 things you want to do? How does the X2B information relate to the original question? |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
Hi dick,
Yes XTOB converts every Hexadecimal character into 4 binary BITS,
eg X2B(04000) yields 0000 0100 0000 0000
But I don't know how to accomplish this is JCL
My input has hexa decimal map code in the format X(3).
I can be able to convert into
(1,3,PD,M11) to yield results like 04000,
04400
08000
etc
Still I need this to convert to X(20) Bitmap
04000 to '0000 0100 0000 0000' or '.... .1.. .... ....'
04400 to '0000 0100 0100 0000' or '.... .1.. .1.. ....'
etc
Is it possible in JCL to do this ?
Thanks,
M.Lokeshwar |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes, you can run your REXX code in batch using IKJEFT01.
Or is your problem in the REXX code that you do not get the results that you want, or both ?
Not sure why you are using SORT statements in REXX to accomplich what the REXX is already doing. |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
I am very new to REXX. I haven't run REXX in batch jobs.
Can u please tell me whether we need a dataset to run REXX in batch job?
Say my input has SSN Suffix + Bitmap(Hexa decimal)
and I have REXX code that converts Bitmap alone to 20 Bits.
Now can u please tell me how to pass the parameter(Bitmap) to REXX and get back the result.
I got the JCL below by searching. Is this the way to pass parameter to REXX?
Then how its possile to pass Bitmap alone(without SSN and suffix ) and get back the result?
//STEPNAME EXEC PGM=IKJEFT01,PARM='exec_member_name argument'
//SYSPRINT DD SYSOUT=A
//SYSEXEC DD DSN=exec_data_set_name,DISP=SHR
//SYSTSPRT DD DSN=output_data_set_name,DISP=SHR
//SYSTSIN DD DUMMY
Thanks,
Lokesh |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The JCL that you have shown is fine.
Within the REXX you will need
PARSE ARG whatever .
which reads your parm value (argument) into the variable whatever and can then be processed by the REXX code.
The result is within the REXX exec and if you want to write it out to a dataset then use EXECIO to write it out to the chosen DDname which you need to include in your JCL, unless you have allocated it dynamically from within the REXX.
And - well done, you have researched the REXX batch JCL for yourself after being given a clue. |
|
Back to top |
|
|
lokeshwar_manoharan
New User
Joined: 22 Sep 2008 Posts: 49 Location: Chennai,Tamilnadu
|
|
|
|
Thanks,
Tell me one thing.
My file has lot of records with Bitmaps.
So when each record is processed, REXX command should be executed in JCL.
Here I think only one parameter can be passed..?
Why I decided to go for JCL because, we can submit the job and we can do other things.
But its not possible in the case of rexx.. It will be restricting us from doing other things till its completed.
Or else in rexx itself I ll read the input convert the bitmap and write to output file.
I don't know how much time it ll take for more records. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You can read as many records as you want from a dataset and do numerous processes for each record, just like any other program can do. |
|
Back to top |
|
|
|