midrange.com code scratchpad
Name:
Debug mode value of record field
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
11/06/2019 11:29:20 am
IP:
Logged
Description:
Hi,

When i wrote below cl program
0001.00 pgm
0002.00 chgjob ccsid(37)
0003.00 call ex9
0004.00 endpgm

and when it executes EX9 program i dont see any value getting decrypted during debug mode whereas when i execute this openssl it does show the decrypted value on the console itself.
Code:
  1. program code for ex9 :-
  2.  
  3.      FUNIX      IF   F 1000        SPECIAL PGMNAME('UNIXCMD')
  4.      F                                     PLIST(UNIXPARM)   usropn
  5.      FQSYSPRT   O    F  132        PRINTER
  6.      dencodedExcha...
  7.      dngeToken         s             88
  8.      DSTRING1          S            100
  9.      D cmd             s           5000a
  10.      D mode            s              1A   inz('P')
  11.      D record          ds          1000
  12.      D outrec          ds           132
  13.  
  14.      C     UNIXPARM      PLIST
  15.      C                   PARM                    CMD
  16.      C                   PARM                    MODE
  17.       /free
  18.        XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
  19.        /INPUT.xml':'doc=file case=any path=+
  20.        TokenExchangeResponse/encodedExchangeToken');
  21.        cmd = 'echo'  + ' ' +  encodedExchangeToken + '| openssl +
  22.           enc -d -aes-128-ecb -K +
  23.           363631653237354f494d31554c594c4a -nopad -nosalt +
  24.           -base64 -A -out record';
  25.           open UNIX;
  26.           read UNIX record;
  27.           dow not %eof(UNIX);
  28.              outrec = record;
  29.              write QSYSPRT outrec;
  30.              read UNIX record;
  31.           enddo;
  32.  
  33.           close UNIX;
  34.           *inlr = *on;
  35.       /end-free
  36.  
  37. ****************
  38. value of record field during debug mode:-
  39.  
  40.                               Evaluate Expression                               
  41.                                                                                 
  42.  Previous debug expressions                                                     
  43.                                                                                 
  44.  > EVAL record                                                                  
  45.    RECORD =                                                                     
  46.              ....5...10...15...20...25...30...35...40...45...50...55...60       
  47.         1   '                                                            '      
  48.        61   '                                                            '      
  49.       121   '                                                            '      
  50.       181   '                                                            '      
  51.       241   '                                                            '      
  52.       301   '                                                            '      
  53.       361   '                                                            '      
  54.       421   '                                                            '      
  55.       481   '                                                            '      
  56.       541   '                                                            '      
  57.       601   '                                                            '      
  58.                                                                         More... 
  59.  Debug . . .                                                                    
  60.                                                                                 
  61.  F3=Exit   F9=Retrieve   F12=Cancel   F16=Repeat find   F19=Left   F20=Right    
  62.  F21=Command entry       F23=Display output                                     
  63.                                                                                 
  64.  
  65. Value of CMD field during debug mode:-
  66.  
  67.                               Evaluate Expression                               
  68.                                                                                 
  69.  Previous debug expressions                                                     
  70.                                                                                 
  71.  > EVAL cmd                                                                     
  72.    CMD =                                                                        
  73.              ....5...10...15...20...25...30...35...40...45...50...55...60       
  74.         1   'echo u3VtNgfyWU9faZc3Iaa8ZWbE5UZCfmC17yA4MyW0ghflt9dNQNDpCcg'      
  75.        61   'MZiG/kXPE4vv2CHL93B4iKiODHxxdVA==| openssl enc -d -aes-128-e'      
  76.       121   'cb -K 363631653237354f494d31554c594c4a -nopad -nosalt -base6'      
  77.       181   '4 -A -out record                                            '      
  78.       241   '                                                            '      
  79.       301   '                                                            '      
  80.       361   '                                                            '      
  81.       421   '                                                            '      
  82.       481   '                                                            '      
  83.       541   '                                                            '      
  84.       601   '                                                            '      
  85.                                                                         More... 
  86.  Debug . . .                                                                    
  87.                                                                                 
  88.  F3=Exit   F9=Retrieve   F12=Cancel   F16=Repeat find   F19=Left   F20=Right    
  89.  F21=Command entry       F23=Display output                                     
  90.                                                                                 
  91.  
  92. ****************
  93. Result of interactive openssl command after executing 1) CHGJOB CCSID(37) 2) CALL QSYS/QP2TERM 3) Below OPENSSL Command:-
  94.  
  95. echo 'u3VtNgfyWU9faZc3Iaa8ZWbE5UZCfmC17yA4MyW0ghflt9dNQNDpCcgMZiG/kXPE4vv2CHL
  96. 93B4iKiODHxxdVA==' | openssl enc -d -aes-128-ecb -K 363631653237354f494d31554
  97. c594c4a -nopad -nosalt -base64 -A                                            
  98. 707fbe32-0dbc-41e0-888f-5bc40de8c20d2P9AMPCTQ4CZ                ยข      
  99.  
  100.  
  101.  
© 2004-2019 by midrange.com generated in 0.007s valid xhtml & css