IBM Power Connect, learn, share, and engage with IBMPower. Join / Log in
Like we call specific commands and then environment library list is set by just entering few commands or by following some menu navigation so similarly once we are connected to Ibm i through Vs code then how to set this library list?
It depends on what connection method you use. For example, for ODBC connection, you can set the library list in ODBC data source definition :
But if you want different library list for different ODBC connection to the same data source, you can set it programmatically using connection string keyword DBQ: https://www.ibm.com/docs/en/i/7.4?topic=details-connection-string-keywords
I presume you are using the Code for IBM i extension for VS Code? In there, you can create a so called Command Profile, which will run a command and get the library list set by that command, and use that library list for all following commands.
See more here:
When I added and edited let's say profile name is 'name1' and then i entered one command but after that once i click on 'Save' button then at left side on VS Code window when i expand it using right arrow key 'it does not display that command despite adding it as active profile also i also don't see any change in the 'User library list' section.
What I wanted is like normally when we are inside any emulator using IBM i ACS then we enter some command then it pops up one screen and there i enter some value then i get my application's main menu options so similarly how all thee things could be done in VS Code ?
Also as adviced earlier here does it mean based on ODBC setting a new program needs to be written for the same ?
If you have an issue with using Code for IBM i, please create an issue at the GitHub repository - this is not the right forum to support Code for IBM i.
Also note, that ACS and Code for IBM i are two completely different products:
I'm not sure what you're trying to accomplish using VS Code... Running SQL to view and/or extract data? If yes to SQL, I would recommend keep using ACS for this, since ACS so far is more mature in this area.
Hope this helps.
I wanted to compile and edit source code using this VS Code for source members but it requires a library list to be set up first but since command profile is not working as expected (like after adding it , i can't see associated command with it and not sure how to run this command using this command profile and despite adding this command profile i can't find any changes in the library list ) so considering this scenario how can i use VS Code here?
Note:- for me to start compiling any source code first library list should be setup like this 1) enter command then display screen pops up then i enter certain value over there then i enter one menu option and then another then i get access to command line then i add my library at top of library list then using WRKMBRPDM normally as we do i start editing and compiling any source member so how to all this here using VS Code , i know how to browse or edit any source member in VS Code and how o compile it but as mentioned here for me to do currently i need to set up my lib. list like i set it up in IBM i ACS like this mentioned way.
If the command profile function in Code for IBM i does not work as expected, please report the issue on the GitHub repo - it may be a defect or a usage error, and in any case you can get help there. They (we) try to answer any questions asap...
Your description suggests you're running some program interactively to change the library list - this is not possible in Code for IBM i. But you could circumvent this by doing your normal setup in the 5250 screen and display the resulting library list (DSPLIBL). Then go to Code for IBM i and enter a command in a Command Profile like this:
CHGLIBL LIBL(LIB1 LIB2 LIB3) CURLIB(CURLIB)
where LIB1 LIB2 LIB3 is your list of libraries from the DSPLIBL command, and CURLIB is the current library from the DSPLIBL command.
This way you would have the same setup in Code for IBM i as you have in PDM in 5250.
I just received this news piece a moment ago a and thought this might be of interest to anyone who uses VS code : IBM Releases Db2 For i Extensions For VS Code at https://www.itjungle.com/2023/10/09/ibm-releases-db2-for-i-extensions-for-vs-code/